]> git.ipfire.org Git - thirdparty/openvpn.git/commit
options: add IPv4 support to '--show-gateway <arg>'
authorGert Doering <gert@greenie.muc.de>
Wed, 29 Jan 2025 17:30:07 +0000 (18:30 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 29 Jan 2025 19:23:50 +0000 (20:23 +0100)
commit9df51cf56e27f6103ed5becbafd1f645726d9155
tree51044b99b9d3452ee11ef671b39c271883f845a5
parentb6a2533a3fb29eafe78a2432eaf9adaa0e707420
options: add IPv4 support to '--show-gateway <arg>'

This is an old debug option, which used to print "the default routes found"
for IPv4 and IPv6, and optionally "a route to a particular IPv6 target"
if passed an argument.

With the work started in commit 0fcfc8381f60d we want this to handle
IPv4 as well, mostly to be able to easily test per-platform
get_default_gateway() implementations.

The implementation is simplistic - if <arg> can be parsed as an IPv4 or
IPv6 address, that particular protocol lookup will do "the host route"
and the other one will stick to "the default route".

NOTE: as of this commit, there is no backend functionality for IPv4, so
it will not actually print anything interesting.  This will be added in
further platform dependent commits.

v2: amend --help output
v3: uncrustify (#ifdef block too long, comments at #endif required now)

Change-Id: Ic438c583a782035ecb9b5ea65702a768ae2585f5
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Message-Id: <20250129173007.3280-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30728.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/man-sections/advanced-options.rst
src/openvpn/options.c