From: "cron2 (Code Review)" Date: Tue, 17 Sep 2024 09:41:29 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, ralf@...2726..., frank@...2641... Message-ID: <8bfb6b7d9d83916e53931b7435ff6bac5b6fb0d2-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="kn96TYu55ns="; 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: ralf_lici Cc: flichtenheld , plaisthos , openvpn-devel --kn96TYu55ns= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/73= 7?usp=3Demail ) 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 Acked-by: Frank Lichtenheld Message-Id: <20240917091433.24092-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg29= 261.html Signed-off-by: Gert Doering --- M src/openvpn/tun.c 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 8b6c34d..d5bad86 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: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --kn96TYu55ns= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

Fix check_addr_clash argument order

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

= Change-Id: I5adbe0a79f078221c4bb5f3d39391a81b4d8adce
Signed-off-by: Ralf= Lici <ralf@...2726...>
Acked-by: Frank Lichtenheld <frank@...1665...= 641...>
Message-Id: <20240917091433.24092-1-gert@...1296...>URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg2= 9261.html
Signed-off-by: Gert Doering <gert@...1296...>
---
= M src/openvpn/tun.c
1 file changed, 4 insertions(+), 2 deletions(-)
<= br>
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index= 8b6c34d..d5bad86 100644
--- a/src/openvpn/tun.c
= +++ b/src/openvpn/tun.c
@@ -877,9 +877,10 @@ {
if (curele->ai_f= amily =3D=3D AF_INET)
{
+ const in_addr_t lo= cal =3D ntohl(((struct sockaddr_in *)curele->ai_addr)->sin_addr.s_add= r);
check_addr_clash("local"= ,
tt->type,=
- = ((struct sockaddr_in *)curele->ai_addr)->sin_addr.s_addr,
+ = local,
= tt->local,
tt->= ;remote_netmask);
}
@@ -88= 9,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_addr= )->sin_addr.s_addr,
change 737. To unsubscrib= e, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5adbe0a79f078221c4bb5f3d393= 91a81b4d8adce
Gerrit-Change-Number: 737
Gerrit-PatchSet: 2
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-MessageType: merged
--kn96TYu55ns=--