Browse code

Fix --dns options for TAP adapter

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>

Lev Stipakov authored on 2025/07/31 19:48:27
Showing 1 changed files
... ...
@@ -3579,6 +3579,7 @@ tuntap_options_postprocess_dns(struct options *o)
3579 3579
             {
3580 3580
                 msg(M_WARN, "WARNING: couldn't copy all --dns server addresses to TUN/TAP");
3581 3581
             }
3582
+            tt->dhcp_options |= DHCP_OPTIONS_DHCP_OPTIONAL;
3582 3583
             return;
3583 3584
         }
3584 3585
     }