From: "stipa (Code Review)" Date: Mon, 13 Nov 2023 12:12:57 +0000 In-Reply-To: References: Reply-To: lstipakov@...277..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <8bf97b9686659f11a41ff259ffdad7076dc99543-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="hWE+GUlkAY0="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[release/2.6]: Warn if pushed options require DHCP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --hWE+GUlkAY0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos, stipa. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/424?usp=3Demail to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld Change subject: Warn if pushed options require DHCP ...................................................................... Warn if pushed options require DHCP Some pushed options (such as DOMAIN-SEARCH) require DHCP server to work. Warn user that some options will not work if the current driver (such as dco-win) doesn't support DHCP. Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 Signed-off-by: Lev Stipakov --- M src/openvpn/options.c M src/openvpn/tun.c 2 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/424/3 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index f8d0b2e..82b4f3e 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2486,10 +2486,10 @@ if (options->tuntap_options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED) { - const char *prefix =3D "Some dhcp-options require DHCP server"; + const char *prefix =3D "Some --dhcp-option or --dns options requir= e DHCP server"; if (options->windows_driver !=3D WINDOWS_DRIVER_TAP_WINDOWS6) { - msg(M_USAGE, "%s, which is not supported by selected %s driver= ", + msg(M_USAGE, "%s, which is not supported by the selected %s dr= iver", prefix, print_windows_driver(options->windows_driver)); } else if (options->tuntap_options.ip_win32_type !=3D IPW32_SET_DHCP= _MASQ diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index f857ed1..1b79d42 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6826,6 +6826,13 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, stru= ct tuntap *tt, openvpn_net_ctx_t *ctx) { + if ((tt->options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED) + && tt->windows_driver !=3D WINDOWS_DRIVER_TAP_WINDOWS6) + { + msg(M_WARN, "Some --dhcp-option or --dns options require DHCP serv= er, which is not supported by the selected %s driver. They will be ignored.= ", + print_windows_driver(tt->windows_driver)); + } + /* dco-win already opened the device, which handle we treat as socket = */ if (tuntap_is_dco_win(tt)) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/424?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: release/2.6 Gerrit-Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 Gerrit-Change-Number: 424 Gerrit-PatchSet: 3 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: stipa Gerrit-MessageType: newpatchset --hWE+GUlkAY0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos, stipa. <= /p>

stipa uploaded patch set #3 to this change.

View Change

The following approvals got outdated and were removed: Code-Review-1 by flichtenheld

Warn if pushed options require DHCP

So= me pushed options (such as DOMAIN-SEARCH) require
DHCP server to work. W= arn user that some options
will not work if the current driver (such as = dco-win)
doesn't support DHCP.

Change-Id: Ie512544329a91fae15= 409cb18f29d8be617051a1
Signed-off-by: Lev Stipakov <lev@...515...>=
---
M src/openvpn/options.c
M src/openvpn/tun.c
2 files change= d, 9 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.=
net:29418/openvpn refs/changes/24/424/3
diff --git a/src/openvpn/op=
tions.c b/src/openvpn/options.c
index f8d0b2e..82b4f3e 1006= 44
--- a/src/openvpn/options.c
+++ b/src/op= envpn/options.c
@@ -2486,10 +2486,10 @@

if (options->tuntap_options.dhcp_options & DHCP_= OPTIONS_DHCP_REQUIRED)
{
- const char *prefix =3D "Some dhcp-opti= ons require DHCP server";
+ const char *prefix =3D "Some --dhcp-option or --dns= options require DHCP server";
if (options-&g= t;windows_driver !=3D WINDOWS_DRIVER_TAP_WINDOWS6)
= {
- msg(M_U= SAGE, "%s, which is not supported by selected %s driver",<= br>+ msg(M_USAGE, &q= uot;%s, which is not supported by the selected %s driver",
<= span> prefix, print_windows_driver(options->windows_driv= er));

}
else if (options-= >tuntap_options.ip_win32_type !=3D IPW32_SET_DHCP_MASQ
d= iff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index f85= 7ed1..1b79d42 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -6826,6 +6826,13 @@
= open_tun(const char *dev, const char *dev_type, const char *dev_node= , struct tuntap *tt,
openvpn_net_ctx_t *ctx)

{
+ i= f ((tt->options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED)+ && tt->win= dows_driver !=3D WINDOWS_DRIVER_TAP_WINDOWS6)
+ {
+ msg(M_WARN, "Some --dhcp-option or --dns options r= equire DHCP server, which is not supported by the selected %s driver. They = will be ignored.",
+ print_windows_driver(tt->windows_driver));
+ }
+
/* dco-win already opened= the device, which handle we treat as socket */
if (tu= ntap_is_dco_win(tt))
{

To view, visit change 424. To unsubscribe, or for help writing mail filters= , visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: Ie512544329a91fae15409cb18f2= 9d8be617051a1
Gerrit-Change-Number: 424
Gerrit-PatchSet: 3
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: stipa <lstipakov@...1663...= .>
Gerrit-MessageType: newpatchset
--hWE+GUlkAY0=--