]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix handling of 'route remote_host' for IPv6 transport case.
authorGert Doering <gert@greenie.muc.de>
Fri, 11 Sep 2020 08:59:07 +0000 (10:59 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 11 Sep 2020 09:26:26 +0000 (11:26 +0200)
commitaa34684972eb01bfa5c355d1c8a8a9d384bf0175
treea182e27e99ac93176a49b08ca67b978dd660d693
parent505d5ad8fadcdc56bae07f4b95c05acd93a47c24
Fix handling of 'route remote_host' for IPv6 transport case.

If we connect to a VPN server over IPv6, and the config has a
route like this:

  route remote_host default net_gateway

OpenVPN would try to install a route to "255.255.255.255", which
is obviously bogus.

The bug is twofold: init_route_list() should not set RTSA_REMOTE_HOST
for an "IPV4_INVALID_ADDR" remote_host (wrong condition, this is not
a pointer but an integer, and "invalid" is "-1" numerically here),
and init_route() must not ignore "status = false" returns from
get_special_addr().

I have just added the "if (!status)" check, not done refactoring for
init_route() to see whether I could make it "more pretty".

Trac: #1247

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20200911085907.26004-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20958.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/route.c