]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Restore also ping related options on a reconnect
authorArne Schwabe <arne@rfc2549.org>
Wed, 17 Mar 2021 16:00:38 +0000 (17:00 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 23 Mar 2021 15:22:25 +0000 (16:22 +0100)
This fixes the issue that if a client reconnects the next connection
entries inherits the keepalive settings that were pushed or set by
the previous entry. Since UDP+PULL entries have an implicit 120s
timeout, this timeout also got applied to a TCP session after an
UDP entry.

Patch v2: rebase on master

Reported-By: Jan Just Keijser <janjust@nikhef.nl>
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20210317160038.25828-3-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21675.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c
src/openvpn/options.h

index 1db96fcf2c4969e0a1407b49189e98131f239a5e..51bd56c2bc293bdf29724a6cd6014a4b9138138e 100644 (file)
@@ -3611,6 +3611,11 @@ pre_pull_save(struct options *o)
         o->pre_pull->ciphername = o->ciphername;
         o->pre_pull->authname = o->authname;
         o->pre_pull->keysize = o->keysize;
+
+        /* 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;
+        o->pre_pull->ping_send_timeout = o->ping_send_timeout;
     }
 
 }
@@ -3662,6 +3667,10 @@ pre_pull_restore(struct options *o, struct gc_arena *gc)
         o->ciphername = pp->ciphername;
         o->authname = pp->authname;
         o->keysize = pp->keysize;
+
+        o->ping_rec_timeout = pp->ping_rec_timeout;
+        o->ping_rec_timeout_action = pp->ping_rec_timeout_action;
+        o->ping_send_timeout = pp->ping_send_timeout;
     }
 
     o->push_continuation = 0;
index 2f3ffdb873860aaadd1df90ad604096f173359d2..f3208c7192c90325907e28d12162f361d233ec7c 100644 (file)
@@ -79,6 +79,10 @@ struct options_pre_pull
     const char* authname;
     int keysize;
 
+    int ping_send_timeout;
+    int ping_rec_timeout;
+    int ping_rec_timeout_action;
+
     int foreign_option_index;
 };