Skip to content

Commit

Permalink
dco: pass remoteaddr only for UDP peers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg31078.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
ordex authored and cron2 committed Mar 9, 2025
1 parent cedddc1 commit 90d7881
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/openvpn/dco.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,9 @@ dco_p2p_add_new_peer(struct context *c)
c->c2.tls_multi->dco_peer_id = -1;
}
#endif
int ret = dco_new_peer(&c->c1.tuntap->dco, multi->peer_id,
c->c2.link_sockets[0]->sd, NULL, remoteaddr, NULL, NULL);
int ret = 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;
Expand Down

0 comments on commit 90d7881

Please sign in to comment.