From: "ordex (Code Review)" Date: Fri, 21 Feb 2025 11:05:54 +0000 In-Reply-To: References: Reply-To: a@...2181..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., lstipakov@...277... Message-ID: <0148007e1ca25e4c1bf77853dca89ac358c0069d-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="JlH+rzPsti8="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco: pass remoteaddr only for UDP peers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld , stipa Cc: openvpn-devel --JlH+rzPsti8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, ordex, plaisthos, stipa. Hello flichtenheld, plaisthos, stipa, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/842?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+2 by stipa, Code-Review-1 by flichtenheld The change is no longer submittable: Code-Review and checks~ChecksSubmitRul= e are unsatisfied now. Change subject: dco: pass remoteaddr only for UDP peers ...................................................................... dco: pass remoteaddr only for UDP peers TCP connected sockets do not need any remote addr because the destination is fixed. For this reason we can avoid sending the remote addr along the peer-new dco call. This change is important on Linux because the new 'ovpn' kernel module is stricter when it comes to accepting netlink messages and will reject calls with TCP sockets if a remote address is specified. Change-Id: I76e2e616c6ffe436a9627fa71aaace74030b2f4a Signed-off-by: Antonio Quartulli --- M src/openvpn/dco.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/842/2 diff --git a/src/openvpn/dco.c b/src/openvpn/dco.c index 02fae81..973c848 100644 --- a/src/openvpn/dco.c +++ b/src/openvpn/dco.c @@ -515,8 +515,9 @@ c->c2.tls_multi->dco_peer_id =3D -1; } #endif - int ret =3D dco_new_peer(&c->c1.tuntap->dco, multi->peer_id, - c->c2.link_sockets[0]->sd, NULL, remoteaddr, NU= LL, NULL); + int ret =3D dco_new_peer(&c->c1.tuntap->dco, multi->peer_id, sock->sd,= NULL, + proto_is_dgram(sock->info.proto) ? remoteaddr := NULL, + NULL, NULL); if (ret < 0) { return ret; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/842?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: I76e2e616c6ffe436a9627fa71aaace74030b2f4a Gerrit-Change-Number: 842 Gerrit-PatchSet: 2 Gerrit-Owner: ordex Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-Reviewer: stipa Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Attention: ordex Gerrit-Attention: stipa Gerrit-MessageType: newpatchset --JlH+rzPsti8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, ordex, plaisthos, s= tipa.

ordex uploaded patch set #2 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+2 by stipa, Code-Review-1 by flichtenheld

The change is n= o longer submittable: Code-Review and checks~ChecksSubmitRule are unsatisfi= ed now.

dco: pass remoteaddr only for UDP peers

TCP connected socket= s do not need any remote addr
because the destination is fixed.
For t= his reason we can avoid sending the remote addr
along the peer-new dco c= all.

This change is important on Linux because the new 'ovpn'= ;
kernel module is stricter when it comes to accepting
netlink messag= es and will reject calls with TCP sockets
if a remote address is specifi= ed.

Change-Id: I76e2e616c6ffe436a9627fa71aaace74030b2f4a
Signed-o= ff-by: Antonio Quartulli <antonio@...2726...>
---
M src/openvpn= /dco.c
1 file changed, 3 insertions(+), 2 deletions(-)

git pul= l ssh://gerrit.openvpn.net:29418/openvpn refs/changes/42/842/2
diff=
 --git a/src/openvpn/dco.c b/src/openvpn/dco.c
index 02fae8= 1..973c848 100644
--- a/src/openvpn/dco.c
+= ++ b/src/openvpn/dco.c
@@ -515,8 +515,9 @@
= c->c2.tls_multi->dco_peer_id =3D -1;
}<= /span>
#endif
- int ret =3D dco_new_peer(&c->c1.tuntap->dco, multi->peer= _id,
- = c->c2.link_sockets[0]->sd, NULL, remoteaddr, NULL, NULL);
+ int ret =3D dco_n= ew_peer(&c->c1.tuntap->dco, multi->peer_id, sock->sd, NULL,=
+ = proto_is_dgram(sock->info.proto) ? remoteaddr : NULL,
= + NUL= L, NULL);
if (ret < 0)
{
return ret;

To view= , visit c= hange 842. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I76e2e616c6ffe436a9627fa71aa= ace74030b2f4a
Gerrit-Change-Number: 842
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <a@...2181...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-Reviewer: stipa <lstipakov@...277...= >
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Attention: ordex <a@...2181...> <= /div>
Gerrit-Attention: stipa <lstipakov@...1663...= .>
Gerrit-MessageType: newpatchset
--JlH+rzPsti8=--