]> 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 12:14:05 +0000 (13:14 +0100)
commit705a08ee5adcc74d51bc096592d561f35dc8661a
tree047bc69867f99536fae21b99a3fb5523d100d3e2
parent93d8d92319816a36f53ef8772bd6705f6abc2df9
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>
(cherry picked from commit e04c253618ce2a1bb0996a67b81af891e8607fa9)
src/openvpn/forward.c
src/openvpn/init.c
src/openvpn/init.h
src/openvpn/route.c
src/openvpn/route.h