0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-20 12:02:28 +02:00

Split pf_check_reload check and check timer in process_coarse_timers

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>
This commit is contained in:
Arne Schwabe 2020-08-10 16:36:57 +02:00 committed by Gert Doering
parent feacd01c58
commit ce7ddaaf31
2 changed files with 6 additions and 4 deletions

View 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 */

View 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))