From: "stipa (Code Review)" Date: Thu, 31 Jul 2025 15:09:54 +0000 References: Reply-To: lstipakov@...277..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="bXvic0POZ94="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Fix wrong byte order of --dns server List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --bXvic0POZ94= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1125?usp=3Demail to review the following change. Change subject: Fix wrong byte order of --dns server ...................................................................... Fix wrong byte order of --dns server We already fixed it in commit 82fd89a04f, but the fix got lost in 2dfc4f8. tuntap_options require host byte order, and we store dns servers in struct dns_server in network byte order, what we got from getaddrinfo(). Fix (again) by converting to the host byte order. Change-Id: I37ca672f05e9d77ec586fa28dadc6dc752e574fb Signed-off-by: Lev Stipakov --- M src/openvpn/options.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/25/1125/1 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 3ceada0..ff9addd 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3573,7 +3573,7 @@ { if (s->addr[i].family =3D=3D AF_INET && tt->dns_len + 1 < = N_DHCP_ADDR) { - tt->dns[tt->dns_len++] =3D s->addr[i].in.a4.s_addr; + tt->dns[tt->dns_len++] =3D ntohl(s->addr[i].in.a4.s_ad= dr); } else if (tt->dns6_len + 1 < N_DHCP_ADDR) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1125?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: I37ca672f05e9d77ec586fa28dadc6dc752e574fb Gerrit-Change-Number: 1125 Gerrit-PatchSet: 1 Gerrit-Owner: stipa Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --bXvic0POZ94= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

stipa would like plaisthos and flichtenheld to review t= his change.

V= iew Change

Fix wrong byte order of --dns server

We already fixed= it in commit 82fd89a04f, but
the fix got lost in 2dfc4f8.

tuntap= _options require host byte order, and we store
dns servers in struct dns= _server in network byte order,
what we got from getaddrinfo().

Fi= x (again) by converting to the host byte order.

Change-Id: I37ca672f= 05e9d77ec586fa28dadc6dc752e574fb
Signed-off-by: Lev Stipakov <lev@...493...= 515...>
---
M src/openvpn/options.c
1 file changed, 1 insertion= (+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvp=
n refs/changes/25/1125/1
diff --git a/src/openvpn/options.c b/src/o=
penvpn/options.c
index 3ceada0..ff9addd 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c=
@@ -3573,7 +3573,7 @@
{
if (s->addr[i].family =3D=3D AF_INET &&a= mp; tt->dns_len + 1 < N_DHCP_ADDR)
{=
- t= t->dns[tt->dns_len++] =3D s->addr[i].in.a4.s_addr;
+ tt->dns[tt-&= gt;dns_len++] =3D ntohl(s->addr[i].in.a4.s_addr);

= }
else if (tt->dns6_len + 1 = < N_DHCP_ADDR)
{

To view, visit change 1125. To unsubscribe, or for help writing m= ail filters, visit settings<= /a>.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I37ca672f05e9d77ec586fa28dad= c6dc752e574fb
Gerrit-Change-Number: 1125
Gerrit-PatchSet: 1
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-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--bXvic0POZ94=--