more consistently use pfsync_free_deferral to free the mbuf.
authordlg <dlg@openbsd.org>
Thu, 17 Jun 2021 00:18:09 +0000 (00:18 +0000)
committerdlg <dlg@openbsd.org>
Thu, 17 Jun 2021 00:18:09 +0000 (00:18 +0000)
commitb8dc9bf2edb09a543d6ff84db11cbb5209a0a26f
tree8d79f1c40ff6d0d969a800ba778ee9f59f8ac401
parent6eb4c859e9b6a4a1acf9b5c55557502f5d149733
more consistently use pfsync_free_deferral to free the mbuf.

pfsync_free_deferral doesnt need to check pd_m for NULL before
calling m_freem because m_freem does that anyway.

if pf_setup_pdesc in pfsync_undefer_notify failed, the mbuf was
freed but the pd_m pointer was not cleared, which would have led
to a double free when pfsync_free_deferral tried to do the same
thing for it.

if pfsync_undefer is supposed to drop the mbuf, let pfsync_free_deferral
do it for us.

ok jmatthew@
sys/net/if_pfsync.c