]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Propagate route error to initialization_completed()
authorSelva Nair <selva.nair@gmail.com>
Thu, 5 Jan 2023 02:27:18 +0000 (21:27 -0500)
committerGert Doering <gert@greenie.muc.de>
Tue, 10 Jan 2023 11:28:45 +0000 (12:28 +0100)
commite04c253618ce2a1bb0996a67b81af891e8607fa9
tree79a558381868e02766fdaf8f50511a95aa482a18
parentb520c68c67b6e52cd71b16675f1c436abf18d4dc
Propagate route error to initialization_completed()

Makes it possible to report management state as CONNECTED,ROUTE_ERROR
instead of CONNECTED,SUCCESS in case of routing errors.

This depends on treating "route already exists" as not
an error which right now works when using netlink on Linux
and IPAPI or iservice on Windows.

For route set via command line there is no easy way to get this
information and current behaviour is unchanged: i.e., the management
state continues to be reported as CONNECTED,SUCCESS.

Status notification to systemd is not affected.

To test on Linux, build with netlink and use a --route option with
an unreachable gateway like:
"--route 192.168.122.0 255.255.255.0 1.1.1.1"

Notes:
On windows, if the route method is "exe", setting a route
that exists *may* get logged as error and this patch will lead to
a slightly misleading CONNECTED,ROUTE_ERROR state message. This is
considered tolerable as no one should be using "exe" (i.e. route.exe)
as the route method.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230105022718.1641751-3-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25884.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/forward.c
src/openvpn/init.c
src/openvpn/init.h
src/openvpn/route.c
src/openvpn/route.h