summaryrefslogtreecommitdiff
path: root/sys/net/pf.c
diff options
context:
space:
mode:
authorAlexandr Nedvedicky <sashan@cvs.openbsd.org>2019-08-26 09:19:13 +0000
committerAlexandr Nedvedicky <sashan@cvs.openbsd.org>2019-08-26 09:19:13 +0000
commit19ed3b12ac112df0271964ec842fe1ed90b83334 (patch)
tree51de33aef5fa5a5549d4f0995b3965d842031ac3 /sys/net/pf.c
parent2053f8b9c22cfe384e2b76d90bfd713ee7b63020 (diff)
pf.conf "set timeout interval 1" causes kernel crash
(bug reported and fix tested by Kor) ok kn@
Diffstat (limited to 'sys/net/pf.c')
-rw-r--r--sys/net/pf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index bc33fa723ea..38f87e19ce6 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1087 2019/07/18 20:45:10 sashan Exp $ */
+/* $OpenBSD: pf.c,v 1.1088 2019/08/26 09:19:12 sashan Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1476,6 +1476,9 @@ pf_purge_expired_states(u_int32_t maxcheck)
pf_state_unref(cur);
cur = pf_state_ref(next);
+
+ if (cur == NULL)
+ break;
}
PF_STATE_EXIT_READ();
@@ -1485,7 +1488,7 @@ pf_purge_expired_states(u_int32_t maxcheck)
SLIST_REMOVE_HEAD(&gcl, gc_list);
if (next->timeout == PFTM_UNLINKED)
pf_free_state(next);
- else if (pf_state_expires(next) <= time_uptime) {
+ else {
pf_remove_state(next);
pf_free_state(next);
}