Skip to content

Commit

Permalink
dco: fix source IP selection when multihome
Browse files Browse the repository at this point in the history
When multihome option is enabled, OpenVPN passes ipi_addr to DCO, which
is always 0.0.0.0. It should use ipi_spec_dst instead.

Signed-off-by: Qingfang Deng <[email protected]>
  • Loading branch information
LGA1150 committed Feb 27, 2025
1 parent bca57c1 commit 81cb1b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openvpn/dco.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ dco_multi_get_localaddr(struct multi_context *m, struct multi_instance *mi,
{
struct sockaddr_in *sock_in4 = (struct sockaddr_in *)local;
#if defined(HAVE_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST)
sock_in4->sin_addr = actual->pi.in4.ipi_addr;
sock_in4->sin_addr = actual->pi.in4.ipi_spec_dst;
#elif defined(IP_RECVDSTADDR)
sock_in4->sin_addr = actual->pi.in4;
#else
Expand Down

0 comments on commit 81cb1b5

Please sign in to comment.