pfsync: NULL check sc before using it
In pfsync_defer() we must wait to lock sc until we've ensured it's not NULL. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33240
This commit is contained in:
parent
f499134dd4
commit
27bd812c5c
@ -1739,9 +1739,12 @@ pfsync_defer(struct pf_kstate *st, struct mbuf *m)
|
||||
if (m->m_flags & (M_BCAST|M_MCAST))
|
||||
return (0);
|
||||
|
||||
if (sc == NULL)
|
||||
return (0);
|
||||
|
||||
PFSYNC_LOCK(sc);
|
||||
|
||||
if (sc == NULL || !(sc->sc_ifp->if_flags & IFF_DRV_RUNNING) ||
|
||||
if (!(sc->sc_ifp->if_flags & IFF_DRV_RUNNING) ||
|
||||
!(sc->sc_flags & PFSYNCF_DEFER)) {
|
||||
PFSYNC_UNLOCK(sc);
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user