]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Make --dns options apply for tap-windows6 driver
authorLev Stipakov <lev@openvpn.net>
Wed, 15 Nov 2023 12:06:23 +0000 (13:06 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 15 Nov 2023 14:35:55 +0000 (15:35 +0100)
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.

Github: fixes OpenVPN/openvpn#447

Change-Id: I24f43ad319bd1ca530fe17442d02a97412eb75c7
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Message-Id: <20231115120623.6442-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27402.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index b88fea939db74436bb7995d4be21b705df50f952..bd731ffc6e85af01d395f15952ac94e606d96627 100644 (file)
@@ -1364,6 +1364,7 @@ tuntap_options_copy_dns(struct options *o)
         {
             msg(M_WARN, "WARNING: couldn't copy all --dns search-domains to --dhcp-option");
         }
+        tt->dhcp_options |= DHCP_OPTIONS_DHCP_REQUIRED;
     }
 
     if (dns->servers)
@@ -1401,6 +1402,7 @@ tuntap_options_copy_dns(struct options *o)
         {
             msg(M_WARN, "WARNING: couldn't copy all --dns server addresses to --dhcp-option");
         }
+        tt->dhcp_options |= DHCP_OPTIONS_DHCP_OPTIONAL;
     }
 }
 #else /* if defined(_WIN32) || defined(TARGET_ANDROID) */