summaryrefslogtreecommitdiffstats
path: root/sys/net/if_lagg.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2011-07-07 20:02:09 +0000
committerthompsa <thompsa@FreeBSD.org>2011-07-07 20:02:09 +0000
commit9d0e437193c863bf1af8d6104a6d9d7b8c7aebe0 (patch)
treef8bd80ef2d8cc60a1a9d283c5ae9f2436e69fb48 /sys/net/if_lagg.c
parentf1301f9a76f64361bb7eefc6d0e275bedb2b2b4c (diff)
downloadFreeBSD-src-9d0e437193c863bf1af8d6104a6d9d7b8c7aebe0.zip
FreeBSD-src-9d0e437193c863bf1af8d6104a6d9d7b8c7aebe0.tar.gz
Grab the rlock before checking if our interface is enabled, it could be
possible to hit a dead pointer when changing interfaces. PR: kern/156978 Submitted by: Andrew Boyer MFC after: 1 week
Diffstat (limited to 'sys/net/if_lagg.c')
-rw-r--r--sys/net/if_lagg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index 2548c65..d540966 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -1221,14 +1221,15 @@ lagg_input(struct ifnet *ifp, struct mbuf *m)
struct lagg_softc *sc = lp->lp_softc;
struct ifnet *scifp = sc->sc_ifp;
+ LAGG_RLOCK(sc);
if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ||
(lp->lp_flags & LAGG_PORT_DISABLED) ||
sc->sc_proto == LAGG_PROTO_NONE) {
+ LAGG_RUNLOCK(sc);
m_freem(m);
return (NULL);
}
- LAGG_RLOCK(sc);
ETHER_BPF_MTAP(scifp, m);
m = (*sc->sc_input)(sc, lp, m);
OpenPOWER on IntegriCloud