From: "stipa (Code Review)" Date: Fri, 10 Nov 2023 10:22:01 +0000 References: Reply-To: lstipakov@...277..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <0cc2f4aee0de22a0a54cf7c9761de5de4cf1c819-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="0yJGPxC43Qc="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[release/2.6]: Make --dns options apply for tap-windows6 driver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --0yJGPxC43Qc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/423?usp=3Demail to review the following change. Change subject: Make --dns options apply for tap-windows6 driver ...................................................................... Make --dns options apply for tap-windows6 driver When tap-windows6 driver is used, both --dhcp-option and --dns options are applied with DHCP. When processing --dns options, we don't set "tuntap_options.dhcp_options" member, which is required for DHCP string to be sent to the driver. As a result, --dns options are not applied at all. Fix by adding missing assignment of tuntap_options.dhcp_options. Fixes https://github.com/OpenVPN/openvpn/issues/447 Change-Id: I24f43ad319bd1ca530fe17442d02a97412eb75c7 Signed-off-by: Lev Stipakov --- M src/openvpn/options.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/423/1 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 631ac73..e793a96 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -8014,6 +8014,9 @@ if (streq(p[1], "search-domains") && p[2]) { dns_domain_list_append(&options->dns_options.search_domains, &= p[2], &options->dns_options.gc); +#ifdef _WIN32 + options->tuntap_options.dhcp_options |=3D DHCP_OPTIONS_DHCP_RE= QUIRED; +#endif } else if (streq(p[1], "server") && p[2] && p[3] && p[4]) { @@ -8090,6 +8093,9 @@ msg(msglevel, "--dns server %ld: unknown option type '%s' = or missing or unknown parameter", priority, p[3]); goto err; } +#ifdef _WIN32 + options->tuntap_options.dhcp_options |=3D DHCP_OPTIONS_DHCP_OP= TIONAL; +#endif } else { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/423?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: I24f43ad319bd1ca530fe17442d02a97412eb75c7 Gerrit-Change-Number: 423 Gerrit-PatchSet: 1 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --0yJGPxC43Qc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

stipa would like plaisthos and flichtenheld to review t= his change.

Vi= ew Change

Make --dns options apply for tap-windows6 driver

When = tap-windows6 driver is used, both --dhcp-option and
--dns options are ap= plied with DHCP. When processing --dns options,
we don't set "t= untap_options.dhcp_options" member, which is required
for DHCP stri= ng to be sent to the driver. As a result, --dns options
are not applied = at all.

Fix by adding missing assignment of tuntap_options.dhcp_opti= ons.

Fixes https://github.com/OpenVPN/openvpn/issues/447

Chan= ge-Id: I24f43ad319bd1ca530fe17442d02a97412eb75c7
Signed-off-by: Lev Stip= akov <lev@...515...>
---
M src/openvpn/options.c
1 file chan= ged, 6 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvp=
n.net:29418/openvpn refs/changes/23/423/1
diff --git a/src/openvpn/=
options.c b/src/openvpn/options.c
index 631ac73..e793a96 10= 0644
--- a/src/openvpn/options.c
+++ b/src/= openvpn/options.c
@@ -8014,6 +8014,9 @@
= if (streq(p[1], "search-domains") && p[2]) {
dns_domain_list_append(&= ;options->dns_options.search_domains, &p[2], &options->dns_op= tions.gc);
+#ifdef _W= IN32
+ opt= ions->tuntap_options.dhcp_options |=3D DHCP_OPTIONS_DHCP_REQUIRED;
+#endif
= }
else if (streq(p[1], "server") = && p[2] && p[3] && p[4])
{=
@@ -8090,6 +8093,9 @@
msg= (msglevel, "--dns server %ld: unknown option type '%s' or miss= ing or unknown parameter", priority, p[3]);
= goto err;
}
+#ifdef _WIN32
+ options->tuntap_options.dhcp_options |= =3D DHCP_OPTIONS_DHCP_OPTIONAL;
+#endif
}
else=
{

To view, vi= sit chang= e 423. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I24f43ad319bd1ca530fe17442d0= 2a97412eb75c7
Gerrit-Change-Number: 423
Gerrit-PatchSet: 1
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-MessageType: newchange
--0yJGPxC43Qc=--