From 18d97aa11c78d24ed7a89b34bb47ee08209db29d Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 19 Oct 2011 08:57:17 +0000 Subject: [PATCH] Fix a bug when NPFSYNC > 0 that on FreeBSD we would always return and never remove state. This fixes the problem some people are seeing that state is removed when pf is loaded as a module but not in situations when compiled into the kernel. Reported by: many on freebsd-pf Tested by: flo MFC after: 3 days --- sys/contrib/pf/net/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c index b3c3af04829c..9b8ed2691ebe 100644 --- a/sys/contrib/pf/net/pf.c +++ b/sys/contrib/pf/net/pf.c @@ -1626,8 +1626,8 @@ pf_free_state(struct pf_state *cur) #if NPFSYNC > 0 #ifdef __FreeBSD__ - if (pfsync_state_in_use_ptr != NULL) - pfsync_state_in_use_ptr(cur); + if (pfsync_state_in_use_ptr != NULL && + pfsync_state_in_use_ptr(cur)) #else if (pfsync_state_in_use(cur)) #endif