This move the timer check into process_coarse_timers and makes in line
with the other functions. The the pf.enabled check is also moved
process_coarse_timers to make it more clear this only is used if
pf is enabled at all.

Signed-off-by: Arne Schwabe <a...@rfc2549.org>
---
 src/openvpn/forward.c | 6 +++++-
 src/openvpn/pf.c      | 4 +---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/openvpn/forward.c b/src/openvpn/forward.c
index 7ac878f9..27a40b0c 100644
--- a/src/openvpn/forward.c
+++ b/src/openvpn/forward.c
@@ -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 */
diff --git a/src/openvpn/pf.c b/src/openvpn/pf.c
index b8da26e4..f9bbfb50 100644
--- a/src/openvpn/pf.c
+++ b/src/openvpn/pf.c
@@ -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))
-- 
2.26.2



_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to