diff --git a/sys/contrib/pf/net/pf_if.c b/sys/contrib/pf/net/pf_if.c index 21d8c0022fb7..438e2ee67c9d 100644 --- a/sys/contrib/pf/net/pf_if.c +++ b/sys/contrib/pf/net/pf_if.c @@ -849,10 +849,13 @@ pfi_maybe_destroy(struct pfi_kif *p) int i, j, k, s; struct pfi_kif *q = p->pfik_parent; +#ifdef __FreeBSD__ + if ((p->pfik_flags & (PFI_IFLAG_ATTACHED | PFI_IFLAG_GROUP)) || + ((p->pfik_rules > 0 || p->pfik_states > 0) && + (p->pfik_flags & PFI_IFLAG_PLACEHOLDER) == 0)) +#else if ((p->pfik_flags & (PFI_IFLAG_ATTACHED | PFI_IFLAG_GROUP)) || p->pfik_rules > 0 || p->pfik_states > 0) -#ifdef __FreeBSD__ - if (!(p->pfik_flags & PFI_IFLAG_PLACEHOLDER)) #endif return (0);