From: "cron2 (Code Review)" Date: Wed, 15 Nov 2023 15:14:31 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <5bd78b6e9ae942403f8b4c2c610a6989ab3b9b65-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="U32bQBlOlCg="; 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: stipa , plaisthos , flichtenheld Cc: openvpn-devel --U32bQBlOlCg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#5) to the change originally created by= stipa. ( http://gerrit.openvpn.net/c/openvpn/+/424?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 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 such options will not work if the current driver (such as dco-win) doesn't support DHCP. Change-Id: Ie512544329a91fae15409cb18f29d8be617051a1 Signed-off-by: Lev Stipakov Acked-by: Frank Lichtenheld Message-Id: <20231115120656.6825-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 403.html Signed-off-by: Gert Doering (cherry picked from commit 85fc834b0229b87e466b4f60bd2618b2ecd27a5f) --- M src/openvpn/options.c M src/openvpn/tun.c 2 files changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/424/5 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 9502982..7ca77a8 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2485,10 +2485,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..82ab6c0 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6826,6 +6826,14 @@ 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: 5 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --U32bQBlOlCg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #5 to the change originally cr= eated by stipa.

View Change

The following approvals got outdated and= were removed: Code-Review+2 by flichtenheld

Warn if pushed options require DHCP

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

Change-Id: Ie512544329a91fae1= 5409cb18f29d8be617051a1
Signed-off-by: Lev Stipakov <lev@...515...>= ;
Acked-by: Frank Lichtenheld <frank@...2641...>
Message-Id: &l= t;20231115120656.6825-1-gert@...1296...>
URL: https://www.mail-archiv= e.com/openvpn-devel@lists.sourceforge.net/msg27403.html
Signed-off-by: G= ert Doering <gert@...1296...>
(cherry picked from commit 85fc834b0= 229b87e466b4f60bd2618b2ecd27a5f)
---
M src/openvpn/options.c
M src= /openvpn/tun.c
2 files changed, 10 insertions(+), 2 deletions(-)

=
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/424/5
=
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
= index 9502982..7ca77a8 100644
--- a/src/openvpn/optio= ns.c
+++ b/src/openvpn/options.c
@@ -2485,1= 0 +2485,10 @@

if (options->tuntap= _options.dhcp_options & DHCP_OPTIONS_DHCP_REQUIRED)
= {
- const char= *prefix =3D "Some dhcp-options require DHCP server";
<= span style=3D"color: hsl(120, 100%, 40%);">+ const char *prefix =3D = "Some --dhcp-option or --dns options require DHCP server";=
if (options->windows_driver !=3D WINDOWS_DRIVER_TAP_W= INDOWS6)
{
- msg(M_USAGE, "%s, which is not supported by = selected %s driver",
+ msg(M_USAGE, "%s, which is not supported by the sele= cted %s driver",
prefix, print_window= s_driver(options->windows_driver));
} else if (options->tuntap_options.ip_win32_type !=3D IPW3= 2_SET_DHCP_MASQ
diff --git a/src/openvpn/tun.c b/src/openvp= n/tun.c
index f857ed1..82ab6c0 100644
--- a= /src/openvpn/tun.c
+++ b/src/openvpn/tun.c
= @@ -6826,6 +6826,14 @@
open_tun(const char *dev, const cha= r *dev_type, const char *dev_node, struct tuntap *tt,
= openvpn_net_ctx_t *ctx)
{
+ if ((tt->options.dhcp_options & DHCP= _OPTIONS_DHCP_REQUIRED)
+ && tt->windows_driver !=3D WINDOWS_DRIVER_TAP_WINDOW= S6)
+ {
= + msg(M_WARN, "Some= --dhcp-option or --dns options require DHCP server,"
+ " which is not supp= orted by the selected %s driver. They will be"
+ " ignored.", print_= windows_driver(tt->windows_driver));
+ }
+
/* dco-win already opened the device, which han= dle we treat as socket */
if (tuntap_is_dco_win(tt))
{

To view, visit change 424<= /a>. 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: 5
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-MessageType: newpatchset
--U32bQBlOlCg=--