From 57c8d220aab14b661bafd4fafc40c195326b8d8f Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 16 Apr 2021 15:35:12 +0200 Subject: [PATCH] Also restore/save route-gateway options on SIGUSR1 reconnects Trac: #1396 Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20210416133512.1176870-1-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22132.html Signed-off-by: Gert Doering --- src/openvpn/options.c | 6 ++++++ src/openvpn/options.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 7457d0c5b..3dd22d528 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3585,6 +3585,9 @@ pre_connect_save(struct options *o) o->pre_connect->client_nat_defined = true; } + o->pre_connect->route_default_gateway = o->route_default_gateway; + o->pre_connect->route_ipv6_default_gateway = o->route_ipv6_default_gateway; + /* NCP related options that can be overwritten by a push */ o->pre_connect->ciphername = o->ciphername; o->pre_connect->authname = o->authname; @@ -3632,6 +3635,9 @@ pre_connect_restore(struct options *o, struct gc_arena *gc) o->routes_ipv6 = NULL; } + o->route_default_gateway = pp->route_default_gateway; + o->route_ipv6_default_gateway = pp->route_ipv6_default_gateway; + if (pp->client_nat_defined) { cnol_check_alloc(o); diff --git a/src/openvpn/options.h b/src/openvpn/options.h index 96dfe0780..c55384c7b 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -70,6 +70,9 @@ struct options_pre_connect bool routes_ipv6_defined; struct route_ipv6_option_list *routes_ipv6; + const char *route_default_gateway; + const char *route_ipv6_default_gateway; + bool client_nat_defined; struct client_nat_option_list *client_nat; -- 2.47.2