| Message ID | 20220813204224.22576-2-a@unstable.cc |
|---|---|
| State | Changes Requested |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id WEZxJwcN+GKlAwAAIUCqbw (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Sat, 13 Aug 2022 16:43:51 -0400 Received: from proxy3.mail.ord1d.rsapps.net ([172.30.191.6]) by director10.mail.ord1d.rsapps.net with LMTP id 4JZSJwcN+GIyAgAApN4f7A (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Sat, 13 Aug 2022 16:43:51 -0400 Received: from smtp3.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy3.mail.ord1d.rsapps.net with LMTPS id gCwTJwcN+GJNAwAA7WKfLA (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Sat, 13 Aug 2022 16:43:51 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp3.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=unstable.cc; dmarc=fail (p=none; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: a2f1580c-1b48-11ed-b089-5254006d4589-1-1 Received: from [216.105.38.7] ([216.105.38.7:37334] helo=lists.sourceforge.net) by smtp3.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id DD/17-27936-60D08F26; Sat, 13 Aug 2022 16:43:51 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1oMxyF-0005gB-UR; Sat, 13 Aug 2022 20:42:59 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <a@unstable.cc>) id 1oMxyE-0005fp-AG for openvpn-devel@lists.sourceforge.net; Sat, 13 Aug 2022 20:42:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=dCldb/+B1PpcBkMtZmqtObS/gWDFKsFzpsKuhx5ZdiU=; b=Ierg1fLfwh9CO/5Sgul4K5mb2z 3bEYnTEO0eB+SdgZkAx+fYgo+ixwokJsCBTRZt/JwdY5c2zkv1V+d9t6EPfIXPfmcWoFH3GFG83WG +uy4X0Hv3Ydj/MYBxeu50bRgAc2rS5zvhrJdeODBxidsxJZIDo0JygPm0kui0CEYWf/c=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dCldb/+B1PpcBkMtZmqtObS/gWDFKsFzpsKuhx5ZdiU=; b=T2x3uBz+oqo+eeKlOW/FmGGUnz 8D1/uobxNfvYlt+jGWo57MuDGYztZ4W/3y9qOoArOC7vAv+/tiXfjGzYaA+8/bcMAwQoa4p8LMCXC nSz64cF27C0QD6kJhfsaH/9xqIaf9iwKKgaqCEv3mfxglk5FDo4M/ZV01Izbe2WN61WU=; Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oMxxx-0004cH-Vm for openvpn-devel@lists.sourceforge.net; Sat, 13 Aug 2022 20:42:58 +0000 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id D9B5B1D2B; Sat, 13 Aug 2022 22:42:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1660423354; s=20220809-q8oc; d=unstable.cc; i=a@unstable.cc; h=From:Cc:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; l=1970; bh=dCldb/+B1PpcBkMtZmqtObS/gWDFKsFzpsKuhx5ZdiU=; b=LgZczSiBssuHCCbmbq0BXLKZKFQuuOHkTkDzAN2JHpqk4mwT+24SstYpBJNqrJ5c J4EzKbHLRXKvNmW3UgKqsXQmm19CPK0HICCT8JeVSQXT+WxfrW4MFzLLztRlg1biiB3 57EuFES2muPEUtXcWegUHz33eYpSdDGU8q5Wa6FDO/WM/5AonyqZNcKn53QdX+vVsxB DN1qdpIH9Gu+68gFc7EXHpiic594aarEXDl0yqMSturYVFHS6Lr7WV7eeBD2zFhq9g/ Z+AM160u/+actNAgFRxp3RPQ5FzXm01tL8/kEEz2BztU8kqyWVcIr/jtYuWK8/f8UBg kw56m904og== Received: by smtp.mailfence.com with ESMTPSA ; Sat, 13 Aug 2022 22:42:32 +0200 (CEST) From: Antonio Quartulli <a@unstable.cc> To: openvpn-devel@lists.sourceforge.net Date: Sat, 13 Aug 2022 22:42:19 +0200 Message-Id: <20220813204224.22576-2-a@unstable.cc> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220813204224.22576-1-a@unstable.cc> References: <20220813204224.22576-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Status: No, hits=-2.9 required=4.7 symbols=ALL_TRUSTED, BAYES_00, T_SCC_BODY_TEXT_LINE device=10.2.0.20 X-ContactOffice-Account: com:375058688 X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: At the moment dco-win doesn't support --persist-tun and --server, so check for these options at startup time. Signed-off-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Lev Stipakov <lev@openvpn.net> --- Changes from v100: * improved commit title/message --- src/openvpn/dco.c | 17 +++++++++++++++-- src/o [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.3.242.68 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1oMxxx-0004cH-Vm Subject: [Openvpn-devel] [PATCH v101 2/7] dco-win: check for incompatible options X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Cc: Lev Stipakov <lev@openvpn.net>, Antonio Quartulli <a@unstable.cc> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel,v101,1/7] dco-win: introduce low-level code for handling ovpn-dco-win in Windows
|
|
Commit Message
Antonio Quartulli
Aug. 13, 2022, 10:42 a.m. UTC
At the moment dco-win doesn't support --persist-tun and --server, so check for these options at startup time. Signed-off-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Lev Stipakov <lev@openvpn.net> --- Changes from v100: * improved commit title/message --- src/openvpn/dco.c | 17 +++++++++++++++-- src/openvpn/options.c | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-)
Comments
Again, this cannot be tested yet. Stared at the code and tested with follow-up commits, looks good and works as expected. Acked-by: Lev Stipakov <lstipakov@gmail.com> la 13. elok. 2022 klo 23.43 Antonio Quartulli (a@unstable.cc) kirjoitti: > At the moment dco-win doesn't support --persist-tun and --server, > so check for these options at startup time. > > Signed-off-by: Antonio Quartulli <a@unstable.cc> > Signed-off-by: Lev Stipakov <lev@openvpn.net> > --- > Changes from v100: > * improved commit title/message > --- > src/openvpn/dco.c | 17 +++++++++++++++-- > src/openvpn/options.c | 5 +++++ > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c > index b342bee1..dcb570f9 100644 > --- a/src/openvpn/dco.c > +++ b/src/openvpn/dco.c > @@ -221,7 +221,20 @@ dco_update_keys(dco_context_t *dco, struct tls_multi > *multi) > static bool > dco_check_option_conflict_platform(int msglevel, const struct options *o) > { > -#if defined(TARGET_LINUX) > +#if defined(_WIN32) > + if (o->mode == MODE_SERVER) > + { > + msg(msglevel, "Only client and p2p data channel offload is > supported " > + "with ovpn-dco-win."); > + return false; > + } > + > + if (o->persist_tun) > + { > + msg(msglevel, "--persist-tun is not supported with > ovpn-dco-win."); > + return false; > + } > +#elif defined(TARGET_LINUX) > /* if the device name is fixed, we need to check if an interface with > this > * name already exists. IF it does, it must be a DCO interface, > otherwise > * DCO has to be disabled in order to continue. > @@ -246,7 +259,7 @@ dco_check_option_conflict_platform(int msglevel, const > struct options *o) > strerror(-ret), ret); > } > } > -#endif /* if defined(TARGET_LINUX) */ > +#endif /* if defined(_WIN32) */ > return true; > } > > diff --git a/src/openvpn/options.c b/src/openvpn/options.c > index 14cb4cc4..cec6cf10 100644 > --- a/src/openvpn/options.c > +++ b/src/openvpn/options.c > @@ -2450,6 +2450,11 @@ options_postprocess_verify_ce(const struct options > *options, > { > msg(M_USAGE, "--windows-driver wintun requires --dev tun"); > } > + > + if (options->windows_driver == WINDOWS_DRIVER_DCO) > + { > + dco_check_option_conflict(M_USAGE, options); > + } > #endif /* ifdef _WIN32 */ > > /* > -- > 2.35.1 > > > > _______________________________________________ > Openvpn-devel mailing list > Openvpn-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openvpn-devel >
Hi, On Sat, Aug 13, 2022 at 10:42:19PM +0200, Antonio Quartulli wrote: > At the moment dco-win doesn't support --persist-tun and --server, > so check for these options at startup time. This needs rebasing anyway (due to the startup change), but while at it... > + > + if (options->windows_driver == WINDOWS_DRIVER_DCO) > + { > + dco_check_option_conflict(M_USAGE, options); > + } ... this should read "if (dco_enabled(options))", no? Patch 3/7 changes dco_enabled() to do exactly this "if (driver == WINDOWS_DRIVER_DCO)" and it would make *this* function more clear. OTOH, the first thing dco_check_options_conflict() does is "check if DCO is enabled at all", so why check it in the caller again? Staring at this for a while, I do wonder why we do the "linux DCO" options check in options_postprocess_mutate(), and the "Win32 DCO" options check in options_postprocess_verify_ce() (while it does not look at the actual ->ce entries, and really *really* does not belong). Can we please clean this up, and have one joint call for all DCO platforms? I see no good reason for having two calls to the same function, doing the same thing, in two different call chains for different OSes. Now there is a material difference, if the Win32 invocation finds a dco-incompatible option, it will exit M_USAGE, while Linux will just disable DCO - if this is what we want, we should still keep the stuff closer together, like /* check if any option should force disabling DCO */ #if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) o->tuntap_options.disable_dco = !dco_check_option_conflict(D_DCO, o) || !dco_check_startup_option_conflict(D_DCO, o); #else if _WIN32 /* we can not currently fallback to non-DCO on Windows, so exit M_USAGE * if an option conflict is discovered */ dco_check_option_conflict(M_USAGE, o); dco_check_startup_option_conflict(M_USAGE, o); #endif gert
Hi, On Thu, Aug 18, 2022 at 11:26:38AM +0200, Antonio Quartulli wrote: > -#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD) > - o->tuntap_options.disable_dco = !dco_check_option_conflict(D_DCO, o) > - || !dco_check_startup_option_conflict(D_DCO, o); > -#endif > + o->tuntap_options.disable_dco = !dco_check_option_conflict(DCO_CHECK_OPTION_LEVEL, o) > + || !dco_check_startup_option_conflict(DCO_CHECK_OPTION_LEVEL, o); Nah, this is not good. This reads as "this is code which will always return, and will log with some arbitrary log level" (how would a reader know that D_DCO and DCO_CHECK_OPTION_LEVEL is not both coming from errror.h?). Make it explicit, and explain why. gert
diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index b342bee1..dcb570f9 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -221,7 +221,20 @@ dco_update_keys(dco_context_t *dco, struct tls_multi *multi) static bool dco_check_option_conflict_platform(int msglevel, const struct options *o) { -#if defined(TARGET_LINUX) +#if defined(_WIN32) + if (o->mode == MODE_SERVER) + { + msg(msglevel, "Only client and p2p data channel offload is supported " + "with ovpn-dco-win."); + return false; + } + + if (o->persist_tun) + { + msg(msglevel, "--persist-tun is not supported with ovpn-dco-win."); + return false; + } +#elif defined(TARGET_LINUX) /* if the device name is fixed, we need to check if an interface with this * name already exists. IF it does, it must be a DCO interface, otherwise * DCO has to be disabled in order to continue. @@ -246,7 +259,7 @@ dco_check_option_conflict_platform(int msglevel, const struct options *o) strerror(-ret), ret); } } -#endif /* if defined(TARGET_LINUX) */ +#endif /* if defined(_WIN32) */ return true; } diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 14cb4cc4..cec6cf10 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2450,6 +2450,11 @@ options_postprocess_verify_ce(const struct options *options, { msg(M_USAGE, "--windows-driver wintun requires --dev tun"); } + + if (options->windows_driver == WINDOWS_DRIVER_DCO) + { + dco_check_option_conflict(M_USAGE, options); + } #endif /* ifdef _WIN32 */ /*