From: Arne Schwabe Date: Fri, 16 Apr 2021 13:35:12 +0000 (+0200) Subject: Also restore/save route-gateway options on SIGUSR1 reconnects X-Git-Tag: v2.5.2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b594d4980f696583397a3b87e5c928acba17081;p=thirdparty%2Fopenvpn.git 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 (cherry picked from commit 57c8d220aab14b661bafd4fafc40c195326b8d8f) --- diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 6fcbd4dd1..58349ba8d 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3598,6 +3598,9 @@ pre_pull_save(struct options *o) o->pre_pull->client_nat_defined = true; } + o->pre_pull->route_default_gateway = o->route_default_gateway; + o->pre_pull->route_ipv6_default_gateway = o->route_ipv6_default_gateway; + /* Ping related options should be reset to the config values on reconnect */ o->pre_pull->ping_rec_timeout = o->ping_rec_timeout; o->pre_pull->ping_rec_timeout_action = o->ping_rec_timeout_action; @@ -3637,6 +3640,9 @@ pre_pull_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 79dbea849..15ef9677f 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -72,6 +72,9 @@ struct options_pre_pull 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;