pf: add missing unlock

If we fail to unshare the mbuf we forgot to unlock the rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost 2024-11-20 11:45:39 +01:00
parent 3e2a7a2cbe
commit 81f7ad324d

View file

@ -9043,8 +9043,10 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0
if (__predict_false(! M_WRITABLE(*m0))) {
*m0 = m_unshare(*m0, M_NOWAIT);
if (*m0 == NULL)
if (*m0 == NULL) {
PF_RULES_RUNLOCK();
return (PF_DROP);
}
}
pf_init_pdesc(&pd, *m0);