]> git.ipfire.org Git - thirdparty/openvpn.git/commit
get_default_gateway(): implement platform support for Linux/IPROUTE2
authorGert Doering <gert@greenie.muc.de>
Fri, 31 Jan 2025 08:47:07 +0000 (09:47 +0100)
committerGert Doering <gert@greenie.muc.de>
Fri, 31 Jan 2025 09:36:58 +0000 (10:36 +0100)
commitd83afe0e0c878164886d83f3ffddbc63680a6310
tree8754fa0725751ae8ff66776d9769bea72516c6b9
parentf28c254da58c7a48592c2c63c0a98b38283405e8
get_default_gateway(): implement platform support for Linux/IPROUTE2

Remove the old "read /proc/net/route and try to parse it" implementation
and always use the sitnl/netlink implementation of net_route_v4_best_gw().

This was kept "because we had it and it was working" but does not really
provide any benefit - netlink for route queries is there for v6 anyway,
and the main argument for keeping --enable-iproute2 is "some users want
to run non-standard 'ip' binaries to do things" - which is not affected
by this change.

Change-Id: I6f17140109106b37e6b0e690df1d87720ccf6f91
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <a@unstable.cc>
Message-Id: <20250131084707.24905-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30748.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/networking_iproute2.c
src/openvpn/networking_sitnl.c