summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsashan <sashan@openbsd.org>2019-07-18 20:45:10 +0000
committersashan <sashan@openbsd.org>2019-07-18 20:45:10 +0000
commit745adf1799919f3eb95fc0da8a5d722933d660d9 (patch)
tree8f4dec4225ee25effb61d2aedf0647a831d30f40
parentFix unveiling nonexistent files on read-only filesystems (diff)
downloadwireguard-openbsd-745adf1799919f3eb95fc0da8a5d722933d660d9.tar.xz
wireguard-openbsd-745adf1799919f3eb95fc0da8a5d722933d660d9.zip
follow up to 'once rule' expiration
ok lteo@
-rw-r--r--sys/net/pf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index b858c43963b..bc33fa723ea 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1086 2019/07/18 02:03:46 lteo Exp $ */
+/* $OpenBSD: pf.c,v 1.1087 2019/07/18 20:45:10 sashan Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -3963,8 +3963,9 @@ pf_test_rule(struct pf_pdesc *pd, struct pf_rule **rm, struct pf_state **sm,
* insert an expired rule to gcl.
*/
rule_flag = r->rule_flag;
- if (atomic_cas_uint(&r->rule_flag, rule_flag,
- rule_flag | PFRULE_EXPIRED) == rule_flag) {
+ if (((rule_flag & PFRULE_EXPIRED) == 0) &&
+ atomic_cas_uint(&r->rule_flag, rule_flag,
+ rule_flag | PFRULE_EXPIRED) == rule_flag) {
r->exptime = time_second;
SLIST_INSERT_HEAD(&pf_rule_gcl, r, gcle);
}