]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Also restore/save route-gateway options on SIGUSR1 reconnects
authorArne Schwabe <arne@rfc2549.org>
Fri, 16 Apr 2021 13:35:12 +0000 (15:35 +0200)
committerGert Doering <gert@greenie.muc.de>
Sat, 17 Apr 2021 09:43:43 +0000 (11:43 +0200)
Trac: #1396

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
(cherry picked from commit 57c8d220aab14b661bafd4fafc40c195326b8d8f)

src/openvpn/options.c
src/openvpn/options.h

index 6fcbd4dd1c62d3858d56dbfd3b9b4c15997c3803..58349ba8d2f99b7532055acc6fe87fd4cb2937c0 100644 (file)
@@ -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);
index 79dbea8491ec60b9fa3f502809a215f4edbca4b7..15ef9677ffba17f97fc33eb031ea904d3a545289 100644 (file)
@@ -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;