pf: fix pfi_ifnet leak on interface removal
authorNick Reilly <nreilly@blackberry.com>
Wed, 30 Nov 2022 14:19:44 +0000 (15:19 +0100)
committerKristof Provost <kp@FreeBSD.org>
Wed, 14 Dec 2022 09:19:01 +0000 (10:19 +0100)
commitbfeef0d32a0036bf6bec93a439e0466efe6f4482
tree8e6477cb3e82a41c4d10689598bf6c440c67a9a8
parente6fc01f6be36a87df59ca225de547e07ad7ade35
pf: fix pfi_ifnet leak on interface removal

The detach of the interface and group were leaving pfi_ifnet memory
behind. Check if the kif still has references, and clean it up if it
doesn't

On interface detach, the group deletion was notified first and then a
change notification was sent. This would recreate the group in the kif
layer. Reorder the change to before the delete.

PR: 257218
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D37569
sys/net/if.c
sys/netpfil/pf/pf_if.c