From: "cron2 (Code Review)" Date: Tue, 24 Dec 2024 22:25:01 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <44e94604600beffc36bf8e18e7329df74b354e6c-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="jHRdSxGQUBw="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: repair DNS address option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa Cc: plaisthos , flichtenheld , openvpn-devel --jHRdSxGQUBw= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/84= 5?usp=3Demail ) Change subject: repair DNS address option ...................................................................... repair DNS address option Commit 6f2d222 ("dns: store IPv4 addresses in network byte order") changed the internal representation of IPv4 address within DNS settings to network byte order, however later this value is copied into tuntap_options, where IPv4 addresses are assumed to be in host byte order (see lots of occurences of "htonl(tt->" in tun.c). As a consequence, DNS server address is set incorrectly, like 4.4.8.8 instead of 8.8.4.4 Fix by converting address to host byte order when copying from DNS options to tuntap_options. Change-Id: I87e4593e6a548bacd40b840cd241950019fa457d Signed-off-by: Lev Stipakov Acked-by: Gert Doering Message-Id: <20241224174233.13005-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 195.html Signed-off-by: Gert Doering --- M src/openvpn/options.c 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index b2a3a8b..20e8d55 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -1390,7 +1390,7 @@ overflow =3D true; continue; } - tt->dns[tt->dns_len++] =3D server->addr[i].in.a4.s_add= r; + tt->dns[tt->dns_len++] =3D ntohl(server->addr[i].in.a4= .s_addr); } else { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/845?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: I87e4593e6a548bacd40b840cd241950019fa457d Gerrit-Change-Number: 845 Gerrit-PatchSet: 2 Gerrit-Owner: stipa Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --jHRdSxGQUBw= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

repair DNS address option

Commit
6f2d222 ("dns: store IPv4 addresses in network byte order")
changed the internal representation of IPv4 address within DNS
sett= ings to network byte order, however later this value is copied into
tunt= ap_options, where IPv4 addresses are assumed to be in host byte
order (s= ee lots of occurences of "htonl(tt->" in tun.c). As a
conse= quence, DNS server address is set incorrectly, like 4.4.8.8 instead
of 8= .8.4.4

Fix by converting address to host byte order when copying fro= m DNS
options to tuntap_options.

Change-Id: I87e4593e6a548bacd40b= 840cd241950019fa457d
Signed-off-by: Lev Stipakov <lev@...515...>Acked-by: Gert Doering <gert@...1296...>
Message-Id: <2024122= 4174233.13005-1-gert@...1296...>
URL: https://www.mail-archive.com/op= envpn-devel@lists.sourceforge.net/msg30195.html
Signed-off-by: Gert Doer= ing <gert@...1296...>
---
M src/openvpn/options.c
1 file cha= nged, 1 insertion(+), 1 deletion(-)

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index b2a3a8b..20e8d55 100644
--- a/src/openvpn/options.= c
+++ b/src/openvpn/options.c
@@ -1390,7 +1= 390,7 @@
overflow =3D true;=
continue;
= }
- = tt->dns[tt->dns_len++] =3D server->addr[i].in.a4.s_addr;
+ tt= ->dns[tt->dns_len++] =3D ntohl(server->addr[i].in.a4.s_addr);
}
else=
{

To view, v= isit chan= ge 845. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I87e4593e6a548bacd40b840cd24= 1950019fa457d
Gerrit-Change-Number: 845
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
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: merged
--jHRdSxGQUBw=--