summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-07-09 13:09:35 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-07-09 13:09:35 +0000
commit2c98b17abafb07d8dc546abab697641a2c563df3 (patch)
tree51e69504efbf13ab16bb0e54be1431d54ed60ada
parent0826e005293f7413d9f791857b8ede38c6bbbc05 (diff)
instead of saying we're using the all the states in the table when
sending a bulk update, only say we're using the states referenced by the next and last pointers into the table. this means the pf timeout thread can keep trimming states during a bulk update.
-rw-r--r--sys/net/if_pfsync.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 5343534e5c9..95894c3cb0c 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.150 2010/07/09 12:07:21 dlg Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.151 2010/07/09 13:09:34 dlg Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -2308,13 +2308,12 @@ pfsync_state_in_use(struct pf_state *st)
if (sc == NULL)
return (0);
- if (st->sync_state != PFSYNC_S_NONE)
+ if (st->sync_state != PFSYNC_S_NONE ||
+ st == sc->sc_bulk_next ||
+ st == sc->sc_bulk_last)
return (1);
- if (sc->sc_bulk_next == NULL && sc->sc_bulk_last == NULL)
- return (0);
-
- return (1);
+ return (0);
}
void