]> git.ipfire.org Git - thirdparty/openvpn.git/commit
check c->c2.link_socket before calling do_init_route_ipv6_list()
authorGert Doering <gert@greenie.muc.de>
Tue, 8 Nov 2016 08:39:23 +0000 (09:39 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 8 Nov 2016 09:07:27 +0000 (10:07 +0100)
commit71e7c5f25174a3046a32720d3d6eb77f87458217
tree82f6488fb7c386ebc22f2857fa2267a5ddeb78f8
parent238cd6440312c59353a40a97b3c45d272561457f
check c->c2.link_socket before calling do_init_route_ipv6_list()

There was an asymmetry in checks before calling do_init_route*_list(),
checking c2.link_socket for IPv4 but not for IPv6 - mainly an oversight
from the time when do_init_route_ipv6_list() did not yet look at the
remote address to determine v6-over-v6 overlaps (2.3 code).

c2.link_socket should never be NULL here, so remove the "silently not
call stuff" condition and replace with ASSERT(c2.link_socket) so we
will notice if the assumption is ever wrong.

Tested in client UDP/TCP mode and server UDP/TCP/P2P and --inetd mode.

Found by Coverity.

While at it, remove "fatal" argument to do_init_route*_list(), which
was "false" in all cases (single invocation each), and remove the
error exit code related to it.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Steffan Karger <steffan.karger@fox-it.com>
Message-Id: <1478594363-12752-1-git-send-email-gert@greenie.muc.de>
URL: http://www.mail-archive.com/search?l=mid&q=1478594363-12752-1-git-send-email-gert@greenie.muc.de
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c