From patchwork Mon Aug 10 04:36:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1364 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id UKizF9JbMV85DQAAIUCqbw for ; Mon, 10 Aug 2020 10:38:10 -0400 Received: from proxy12.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id WLqUF9JbMV8sJQAAIasKDg (envelope-from ) for ; Mon, 10 Aug 2020 10:38:10 -0400 Received: from smtp8.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.ord1d.rsapps.net with LMTP id ULwJF9JbMV8+IwAA7PHxkg ; Mon, 10 Aug 2020 10:38:10 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp8.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 1bedd5c4-db17-11ea-965a-782bcb03304b-1-1 Received: from [216.105.38.7] ([216.105.38.7:44772] helo=lists.sourceforge.net) by smtp8.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id F5/AB-06145-1DB513F5; Mon, 10 Aug 2020 10:38:09 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1k58vU-0004jD-2A; Mon, 10 Aug 2020 14:37:24 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k58vS-0004il-A5 for openvpn-devel@lists.sourceforge.net; Mon, 10 Aug 2020 14:37:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=om65lIgm+AGJ9K54MjZUs+9vTWwRhO6OYTv9irbwBd8=; b=HRxjufUDFdTw8p3ETBGv4jcB6O P82nNe4CQPKU5Ow5E21i6FysyzRbwXD0bVt134x6w4md0+hduVrchoSBp1bP7sQsxwtvSBYvzAptJ zO3sFe5mMtrc3dcah65Ufi0QQ39tthbv6w8URdN6FfIapdzPIR42efH6+94BjYYfLu5U=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=om65lIgm+AGJ9K54MjZUs+9vTWwRhO6OYTv9irbwBd8=; b=Arh2R+ISb8RARFa1upZ0y+zI3J FKwla8LBczjPwMtZHD1H9/kNJX91r+vW1XIr/ylUs2ydwKRDluBDb2Rl3sk4QQNF+e64knjgvLs+Q cU3Sf7yZsNRlkV8vqgzqO3EEI3SJYwNIUZmTk/WNyoWSrq/U3hCM6E1tRdSHCvy5qVWE=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1k58vR-002taU-B6 for openvpn-devel@lists.sourceforge.net; Mon, 10 Aug 2020 14:37:22 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1k58vE-000OS9-H8 for openvpn-devel@lists.sourceforge.net; Mon, 10 Aug 2020 16:37:08 +0200 Received: (nullmailer pid 5901 invoked by uid 10006); Mon, 10 Aug 2020 14:37:08 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Mon, 10 Aug 2020 16:36:57 +0200 Message-Id: <20200810143707.5834-8-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200810143707.5834-1-arne@rfc2549.org> References: <20200810143707.5834-1-arne@rfc2549.org> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1k58vR-002taU-B6 Subject: [Openvpn-devel] [PATCH 07/17] Split pf_check_reload check and check timer in process_coarse_timers X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox 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 Acked-by: Gert Doering --- 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))