]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Split pf_check_reload check and check timer in process_coarse_timers
authorArne Schwabe <arne@rfc2549.org>
Mon, 10 Aug 2020 14:36:57 +0000 (16:36 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 10 Aug 2020 16:35:37 +0000 (18:35 +0200)
This moves the timer check into process_coarse_timers and makes it
in line with the other functions. The the pf.enabled check is also moved
into process_coarse_timers to make it more clear this only is used if
pf is enabled at all.

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20200810143707.5834-8-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20664.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/forward.c
src/openvpn/pf.c

index 7ac878f95b7433a55d38863ce2be59f0324ba3af..27a40b0cd7e6c174daf9da236484ec60225456d1 100644 (file)
@@ -679,7 +679,11 @@ process_coarse_timers(struct context *c)
 #endif
 
 #ifdef PLUGIN_PF
-    pf_check_reload(c);
+    if (c->c2.pf.enabled
+        && event_timeout_trigger(&c->c2.pf.reload, &c->c2.timeval, ETT_DEFAULT))
+    {
+        pf_check_reload(c);
+    }
 #endif
 
     /* process --route options */
index b8da26e4a5e85e4e450f075e068e45bfb43df641..f9bbfb5056b0b10c517a485d0ff6766b046885c4 100644 (file)
@@ -547,9 +547,7 @@ pf_check_reload(struct context *c)
     const int wakeup_transition = 60;
     bool reloaded = false;
 
-    if (c->c2.pf.enabled
-        && c->c2.pf.filename
-        && event_timeout_trigger(&c->c2.pf.reload, &c->c2.timeval, ETT_DEFAULT))
+    if (c->c2.pf.filename)
     {
         platform_stat_t s;
         if (!platform_stat(c->c2.pf.filename, &s))