From: "cron2 (Code Review)" Date: Sat, 13 Sep 2025 17:13:49 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <3fb0cfb782eca0c7d2a77fece494f9d00357c957-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="05mWi1Nut1A="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Preserve --dhcp-option values from local config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa , plaisthos , flichtenheld Cc: openvpn-devel --05mWi1Nut1A= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1181?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Preserve --dhcp-option values from local config ...................................................................... Preserve --dhcp-option values from local config Commit 2dfc4f8 ("dns: deal with --dhcp-options when --dns is active") has changed the way how --dhcp-option values are stored. Instead of storing them directly in tuntap_options, they are now stored in dns_options->from_dhcp. Before connect, we save options before --pull is applied, and for that we call clone_dns_options(). However, this was missing to clone the "from_dhcp" struct, and as a result, the values of --dhcp-option from the local config have been lost. Fix by adding shallow-copying of dhcp_options to clone_dns_options(). It is safe to do because it only contains fixed-size arrays, scalar types and pointers to the strings which this struct doesn't own. Github: closes OpenVPN/openvpn#839 Github: closes OpenVPN/openvpn#840 Change-Id: I815e68dd5d365743faff2b80783b776d9e8a645c Signed-off-by: Lev Stipakov Acked-by: Frank Lichtenheld Message-Id: <20250912132235.44304-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 879.html URL: https://gerrit.openvpn.net/c/openvpn/+/1181 Signed-off-by: Gert Doering --- M src/openvpn/dns.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/81/1181/2 diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c index 8554089..5421004 100644 --- a/src/openvpn/dns.c +++ b/src/openvpn/dns.c @@ -264,6 +264,7 @@ clone.servers_prepull =3D clone_dns_servers(o->servers_prepull, gc); clone.updown =3D o->updown; clone.updown_flags =3D o->updown_flags; + clone.from_dhcp =3D o->from_dhcp; return clone; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1181?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: I815e68dd5d365743faff2b80783b776d9e8a645c Gerrit-Change-Number: 1181 Gerrit-PatchSet: 2 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --05mWi1Nut1A= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

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

View Change

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

Preserve --dhcp-option values from local conf=
ig

Commit

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

has changed the way how --dhcp-option values= are stored. Instead of
storing them directly in tuntap_options, they ar= e now stored in
dns_options->from_dhcp.

Before connect, we sav= e options before --pull is applied, and for that
we call clone_dns_optio= ns(). However, this was missing to clone the
"from_dhcp" struc= t, and as a result, the values of --dhcp-option from
the local config ha= ve been lost.

Fix by adding shallow-copying of dhcp_options to clone= _dns_options(). It
is safe to do because it only contains fixed-size arr= ays, scalar types
and pointers to the strings which this struct doesn= 9;t own.

Github: closes OpenVPN/openvpn#839
Github: closes OpenVP= N/openvpn#840

Change-Id: I815e68dd5d365743faff2b80783b776d9e8a645cSigned-off-by: Lev Stipakov <lev@...515...>
Acked-by: Frank Lich= tenheld <frank@...2641...>
Message-Id: <20250912132235.44304-1-= frank@...2641...>
URL: https://www.mail-archive.com/openvpn-devel@...1484...= ts.sourceforge.net/msg32879.html
URL: https://gerrit.openvpn.net/c/openv= pn/+/1181
Signed-off-by: Gert Doering <gert@...1296...>
---
= M src/openvpn/dns.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/81/1181/2=
diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c
index 8554089..5421004 100644
--- a/src/openvpn/dns.c
+++ b/src/openvpn/dns.c
@@ -264,6 +264,7 @@
clone.servers_prepull =3D clone_dns_servers(o->servers= _prepull, gc);
clone.updown =3D o->updown; clone.updown_flags =3D o->updown_flags;
+ clone.from_dhcp =3D o->from_dhcp= ;

return clone;
}

To view, visit change 1181. To unsubscribe, = or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I815e68dd5d365743faff2b80783= b776d9e8a645c
Gerrit-Change-Number: 1181
Gerrit-PatchSet: 2
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-MessageType: newpatchset
--05mWi1Nut1A=--