From: "ralf_lici (Code Review)" Date: Mon, 9 Sep 2024 13:54:50 +0000 References: Reply-To: ralf@...2726..., 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="5tA5bABuMU0="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: Fix check_addr_clash argument order List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --5tA5bABuMU0= 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/+/737?usp=3Demail to review the following change. Change subject: Fix check_addr_clash argument order ...................................................................... Fix check_addr_clash argument order In init_tun() make sure to pass the --local and --remote addresses in the host order so that they can be compared to the --ifconfig addresses. Change-Id: I5adbe0a79f078221c4bb5f3d39391a81b4d8adce Signed-off-by: Ralf Lici --- M src/openvpn/tun.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/37/737/1 diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 739e008..1cd6ad2 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -877,9 +877,10 @@ { if (curele->ai_family =3D=3D AF_INET) { + const in_addr_t local =3D ntohl(((struct sockaddr_in *= )curele->ai_addr)->sin_addr.s_addr); check_addr_clash("local", tt->type, - ((struct sockaddr_in *)curele->ai_add= r)->sin_addr.s_addr, + local, tt->local, tt->remote_netmask); } @@ -889,9 +890,10 @@ { if (curele->ai_family =3D=3D AF_INET) { + const in_addr_t remote =3D ntohl(((struct sockaddr_in = *)curele->ai_addr)->sin_addr.s_addr); check_addr_clash("remote", tt->type, - ((struct sockaddr_in *)curele->ai_add= r)->sin_addr.s_addr, + remote, tt->local, tt->remote_netmask); } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/737?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: I5adbe0a79f078221c4bb5f3d39391a81b4d8adce Gerrit-Change-Number: 737 Gerrit-PatchSet: 1 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --5tA5bABuMU0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

ralf_lici would like plaisthos and flichtenheld to review this change.

Vi= ew Change

Fix check_addr_clash argument order

In init_tun() make= sure to pass the --local and --remote addresses in
the host order so th= at they can be compared to the --ifconfig addresses.

Change-Id: I5ad= be0a79f078221c4bb5f3d39391a81b4d8adce
Signed-off-by: Ralf Lici <ralf@= ...2726...>
---
M src/openvpn/tun.c
1 file changed, 4 insertion= s(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/open=
vpn refs/changes/37/737/1
diff --git a/src/openvpn/tun.c b/src/open=
vpn/tun.c
index 739e008..1cd6ad2 100644
---= a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -877,9 +877,10 @@
{
= if (curele->ai_family =3D=3D AF_INET)
= {
+ = const in_addr_t local =3D ntohl(((struct sockaddr_in *)curele-= >ai_addr)->sin_addr.s_addr);
che= ck_addr_clash("local",
= tt->type,
+ local,
= tt->local,
= tt->remote_netmask);
= }
@@ -889,9 +890,10 @@
= {
if (curele->ai_family =3D=3D AF_INET)=
{
+ const in_addr_t remote =3D ntohl(((stru= ct sockaddr_in *)curele->ai_addr)->sin_addr.s_addr);
= check_addr_clash("remote",
= tt->type,
- ((struct s= ockaddr_in *)curele->ai_addr)->sin_addr.s_addr,
+ remo= te,
tt->local,
tt->remote_netmask);<= /span>
}

To v= iew, visit change 737. To unsubscribe, or for help writing mail filters, visit <= a href=3D"http://gerrit.openvpn.net/settings">settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5adbe0a79f078221c4bb5f3d393= 91a81b4d8adce
Gerrit-Change-Number: 737
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
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
--5tA5bABuMU0=--