diff options
author | avg <avg@FreeBSD.org> | 2013-02-04 17:29:13 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2013-02-04 17:29:13 +0000 |
commit | 686165fb5fd13537a3eb146b18188cce8121bcd2 (patch) | |
tree | c555de48ab24bbd64c4657fba14b862e3e5d4ad4 | |
parent | 26f22dcb90cb96c51d3abd5143a3e1a78785b73f (diff) | |
download | FreeBSD-src-686165fb5fd13537a3eb146b18188cce8121bcd2.zip FreeBSD-src-686165fb5fd13537a3eb146b18188cce8121bcd2.tar.gz |
ng_ether_ifnet_arrival_event: check interface type before using IFP2NG
The check is copied from vnet_ng_ether_init.
Not sure if it covers all the types that we want to support with
ng_ether.
Reported by: markj
Discussed with: zec
MFC after: 10 days
X-MFC with: r246245
-rw-r--r-- | sys/netgraph/ng_ether.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 6266f40..df2dff5 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -410,11 +410,17 @@ static void ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) { char name[IFNAMSIZ]; - node_p node = IFP2NG(ifp); + node_p node; + + /* Only ethernet interfaces are of interest. */ + if (ifp->if_type != IFT_ETHER + && ifp->if_type != IFT_L2VLAN) + return; /* * Just return if it's a new interface without an ng_ether companion. */ + node = IFP2NG(ifp); if (node == NULL) return; |