Skip to content

Commit

Permalink
Fix check_addr_clash argument order
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg29261.html
Signed-off-by: Gert Doering <[email protected]>
(cherry picked from commit 7d345b1)
  • Loading branch information
ralflici authored and cron2 committed Sep 17, 2024
1 parent f9ab7ed commit 7e6723a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/openvpn/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,10 @@ init_tun(const char *dev, /* --dev option */
{
if (curele->ai_family == AF_INET)
{
const in_addr_t local = ntohl(((struct sockaddr_in *)curele->ai_addr)->sin_addr.s_addr);
check_addr_clash("local",
tt->type,
((struct sockaddr_in *)curele->ai_addr)->sin_addr.s_addr,
local,
tt->local,
tt->remote_netmask);
}
Expand All @@ -891,9 +892,10 @@ init_tun(const char *dev, /* --dev option */
{
if (curele->ai_family == AF_INET)
{
const in_addr_t remote = 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,
remote,
tt->local,
tt->remote_netmask);
}
Expand Down

0 comments on commit 7e6723a

Please sign in to comment.