summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-07-09 13:09:34 +0000
committerdlg <dlg@openbsd.org>2010-07-09 13:09:34 +0000
commit1a382ea1e39e366f58e5bea9d805ac36b2fda5d9 (patch)
treee7ead313fe38fe94f2f91e9702302fcb14c995bf
parentfix pkg_mklocatedb (diff)
downloadwireguard-openbsd-1a382ea1e39e366f58e5bea9d805ac36b2fda5d9.tar.xz
wireguard-openbsd-1a382ea1e39e366f58e5bea9d805ac36b2fda5d9.zip
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