From: "cron2 (Code Review)" Date: Wed, 25 Jun 2025 16:49:48 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, ralf@...2726..., frank@...2641..., antonio@...2726... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="tGGdGlBRuCM="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco linux: avoid sending local port to ovpn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: ralf_lici , plaisthos , flichtenheld Cc: openvpn-devel --tGGdGlBRuCM= 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= ralf_lici. ( http://gerrit.openvpn.net/c/openvpn/+/1068?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by ordex Change subject: dco linux: avoid sending local port to ovpn ...................................................................... dco linux: avoid sending local port to ovpn When sending an OVPN_CMD_NEW_PEER netlink message to ovpn, we currently attempt to include the local port along with the local address. However, `dco_multi_get_localaddr()` does not record the port, so we end up sending a zero value. This zero is rejected by ovpn's netlink policy, leading to an error and aborted connection. Since openvpn does not actually need to send the local port because the module retrieves it directly from the socket, this commit ensures that only the local address is sent. Change-Id: I5d9535d46e5a5488f4a2b637a6fcb99aad668fee Signed-off-by: Ralf Lici Acked-by: Antonio Quartulli Message-Id: <20250625162638.7769-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg31= 971.html Signed-off-by: Gert Doering --- M src/openvpn/dco_linux.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/68/1068/2 diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 0345413..22a445a 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -265,13 +265,11 @@ { NLA_PUT(nl_msg, OVPN_A_PEER_LOCAL_IPV4, sizeof(struct in_addr), &((struct sockaddr_in *)localaddr)->sin_addr); - NLA_PUT_U16(nl_msg, OVPN_A_PEER_LOCAL_PORT, ((struct sockaddr_= in *)localaddr)->sin_port); } else if (localaddr->sa_family =3D=3D AF_INET6) { NLA_PUT(nl_msg, OVPN_A_PEER_LOCAL_IPV6, sizeof(struct in6_addr= ), &((struct sockaddr_in6 *)localaddr)->sin6_addr); - NLA_PUT_U16(nl_msg, OVPN_A_PEER_LOCAL_PORT, ((struct sockaddr_= in6 *)localaddr)->sin6_port); } } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1068?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: I5d9535d46e5a5488f4a2b637a6fcb99aad668fee Gerrit-Change-Number: 1068 Gerrit-PatchSet: 2 Gerrit-Owner: ralf_lici Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --tGGdGlBRuCM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

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

View Change

The following approvals got outdate= d and were removed: Code-Review+2 by ordex

dco linux: avoid sending local port to ovpn

W= hen sending an OVPN_CMD_NEW_PEER netlink message to ovpn, we currently
a= ttempt to include the local port along with the local address. However,
= `dco_multi_get_localaddr()` does not record the port, so we end up
sendi= ng a zero value. This zero is rejected by ovpn's netlink policy,
lea= ding to an error and aborted connection.

Since openvpn does not actu= ally need to send the local port because the
module retrieves it directl= y from the socket, this commit ensures that
only the local address is se= nt.

Change-Id: I5d9535d46e5a5488f4a2b637a6fcb99aad668fee
Signed-o= ff-by: Ralf Lici <ralf@...2726...>
Acked-by: Antonio Quartulli <= ;antonio@...2726...>
Message-Id: <20250625162638.7769-1-gert@...1711...= 96...>
URL: https://www.mail-archive.com/openvpn-devel@...1357...= rge.net/msg31971.html
Signed-off-by: Gert Doering <gert@...1296...>= ;
---
M src/openvpn/dco_linux.c
1 file changed, 0 insertions(+), 2= deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn ref=
s/changes/68/1068/2
diff --git a/src/openvpn/dco_linux.c b/src/open=
vpn/dco_linux.c
index 0345413..22a445a 100644
--- a/src/openvpn/dco_linux.c
+++ b/src/openvpn/dco_linu= x.c
@@ -265,13 +265,11 @@
{=
NLA_PUT(nl_msg, OVPN_A_PEER_LOCAL_IPV4, sizeof(struc= t in_addr),
&((struct sockaddr_in = *)localaddr)->sin_addr);
- NLA_PUT_U16(nl_msg, OVPN_A_PEER_LOCAL_PORT, ((struct sock= addr_in *)localaddr)->sin_port);
}
else if (localaddr->sa_family =3D=3D AF_INET6)
{
NLA_PUT(nl_msg, OVPN_A_PEER_LOC= AL_IPV6, sizeof(struct in6_addr),
&= ;((struct sockaddr_in6 *)localaddr)->sin6_addr);
- NLA_PUT_U16(nl_msg, OVPN_A_PEER= _LOCAL_PORT, ((struct sockaddr_in6 *)localaddr)->sin6_port);
<= span> }
}


To view, visit change 1068. To unsubscribe, or for help writi= ng mail filters, visit setti= ngs.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5d9535d46e5a5488f4a2b637a6f= cb99aad668fee
Gerrit-Change-Number: 1068
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <ralf@...2726...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--tGGdGlBRuCM=--