From: "cron2 (Code Review)" Date: Thu, 31 Jul 2025 12:56:45 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <73d99e32f43fe8b3d61b78e8236159510494d9a9-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="r9W29gsDUr8="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix DNS options duplication on PUSH_UPDATE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa , plaisthos , flichtenheld , d12fk Cc: openvpn-devel --r9W29gsDUr8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1121?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by d12fk Change subject: Fix DNS options duplication on PUSH_UPDATE ...................................................................... Fix DNS options duplication on PUSH_UPDATE Commit 2dfc4f ("dns: deal with --dhcp-options when --dns is active") has removed reset of tuntap DNS options. Due to that, incoming --dns options are added to existing ones instead of overwriting them. It has also added a new storage for --dhcp-option. The push-update code didn't clear it and as a result, incoming --dhcp-option options were added to existing ones instead of overwriting them. Fixed by: - resetting tuntap DNS options (regression from abovementioned commit) - clearing dhcp options storage in push-update code GitHub: fixes OpenVPN/openvpn#804 Change-Id: Ife4d8fc5f8e2183e61226d66a76bbaa02c06f787 Signed-off-by: Lev Stipakov Acked-by: Heiko Hund Message-Id: <20250731122410.12200-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 448.html Signed-off-by: Gert Doering --- M src/openvpn/options.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1121/4 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 3753810..3ceada0 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3527,7 +3527,13 @@ #endif /* if defined(_WIN32) */ /* Copy --dns options to tuntap_options */ + const struct dns_domain *d =3D dns->search_domains; + if (d) + { + tt->domain_search_list_len =3D 0; + } + while (d && tt->domain_search_list_len + 1 < N_SEARCH_LIST_LEN) { tt->domain_search_list[tt->domain_search_list_len++] =3D d->name; @@ -3538,6 +3544,9 @@ msg(M_WARN, "WARNING: couldn't copy all --dns search-domains to TU= N/TAP"); } + tt->dns_len =3D 0; + tt->dns6_len =3D 0; + const struct dns_server *s =3D dns->servers; while (s) { @@ -6212,6 +6221,8 @@ } o->disable_nbt =3D 0; o->dhcp_options =3D 0; + + CLEAR(options->dns_options.from_dhcp); #if defined(TARGET_ANDROID) o->http_proxy_port =3D 0; o->http_proxy =3D NULL; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1121?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ife4d8fc5f8e2183e61226d66a76bbaa02c06f787 Gerrit-Change-Number: 1121 Gerrit-PatchSet: 4 Gerrit-Owner: stipa Gerrit-Reviewer: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --r9W29gsDUr8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

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

View Change

The following approvals got outdated an= d were removed: Code-Review+2 by d12fk

Fix DNS options duplication on PUSH_UPDATE

Co= mmit

2dfc4f ("dns: deal with --dhcp-options when --dns is a= ctive")

has removed reset of tuntap DNS options. Due to that, i= ncoming --dns
options are added to existing ones instead of overwriting = them.

It has also added a new storage for --dhcp-option. The push-up= date
code didn't clear it and as a result, incoming --dhcp-option op= tions
were added to existing ones instead of overwriting them.

Fi= xed by:

- resetting tuntap DNS options (regression from abovementio= ned commit)
- clearing dhcp options storage in push-update code

= GitHub: fixes OpenVPN/openvpn#804

Change-Id: Ife4d8fc5f8e2183e61226d= 66a76bbaa02c06f787
Signed-off-by: Lev Stipakov <lev@...515...>
= Acked-by: Heiko Hund <heiko@...515...>
Message-Id: <20250731122= 410.12200-1-gert@...1296...>
URL: https://www.mail-archive.com/openvp= n-devel@lists.sourceforge.net/msg32448.html
Signed-off-by: Gert Doering = <gert@...1296...>
---
M src/openvpn/options.c
1 file changed= , 11 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.=
net:29418/openvpn refs/changes/21/1121/4
diff --git a/src/openvpn/o=
ptions.c b/src/openvpn/options.c
index 3753810..3ceada0 100= 644
--- a/src/openvpn/options.c
+++ b/src/o= penvpn/options.c
@@ -3527,7 +3527,13 @@
#e= ndif /* if defined(_WIN32) */

/* Cop= y --dns options to tuntap_options */
+
const struct dns_domain *d =3D dns-&= gt;search_domains;
+ = if (d)
+ {
+ tt->domain_se= arch_list_len =3D 0;
= + }
+
while (d && tt->domain_search_list_len + 1 < N_SEARC= H_LIST_LEN)

{
tt->domain_s= earch_list[tt->domain_search_list_len++] =3D d->name;
@@ -3538,6 +3544,9 @@
msg(M_WARN, "WARNING: = couldn't copy all --dns search-domains to TUN/TAP");
}

+ tt->dns_len =3D 0;
+ tt->dns6_len =3D 0;
+
const struct dns_server *s =3D d= ns->servers;
while (s)
{

@@ -6212,6 +6221,8 @@
}
<= span> o->disable_nbt =3D 0;
o-&= gt;dhcp_options =3D 0;
+ CLEA= R(options->dns_options.from_dhcp);
#if defined(TARGET_A= NDROID)
o->http_proxy_port =3D 0; o->http_proxy =3D NULL;

<= /pre>

To view, visit change 1121. To unsubscribe, or for help writing mail fi= lters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ife4d8fc5f8e2183e61226d66a76= bbaa02c06f787
Gerrit-Change-Number: 1121
Gerrit-PatchSet: 4
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: d12fk <heiko@...515...>=
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
--r9W29gsDUr8=--