]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix --dns options for TAP adapter
authorLev Stipakov <lev@openvpn.net>
Thu, 31 Jul 2025 10:48:27 +0000 (12:48 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 31 Jul 2025 10:53:27 +0000 (12:53 +0200)
Commit

    2dfc4f ("dns: deal with --dhcp-options when --dns is active")

has accidentally removed setting of the DHCP_OPTIONS_DHCP_OPTIONAL
flag when copying --dns options. This flag is required to apply options
via DHCP string, which we do for TAP adapter. As a result, --dns options
stopped working for TAP.

Fix by setting this flag when copying --dns options to tuntap_options.

Change-Id: Id95cd14095a03afb3140a03ae96e9f5679e4fe89
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250731104833.23305-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32436.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c

index 53be6f5e052a6ddef3e47c930111ad2708cdcc50..3753810f11f2c5f553dc8ffdc90e463956b37560 100644 (file)
@@ -3579,6 +3579,7 @@ tuntap_options_postprocess_dns(struct options *o)
             {
                 msg(M_WARN, "WARNING: couldn't copy all --dns server addresses to TUN/TAP");
             }
+            tt->dhcp_options |= DHCP_OPTIONS_DHCP_OPTIONAL;
             return;
         }
     }