diff options
author | thompsa <thompsa@FreeBSD.org> | 2005-10-13 23:05:55 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2005-10-13 23:05:55 +0000 |
commit | c697ed218af7d4237b6f734208eda8367b04323c (patch) | |
tree | c656736ae31cfd8d0c85b6d590bdf255e0e293c3 /sys/net/if_ethersubr.c | |
parent | 403d9ed596497ec565802be66a88a66c846893e5 (diff) | |
download | FreeBSD-src-c697ed218af7d4237b6f734208eda8367b04323c.zip FreeBSD-src-c697ed218af7d4237b6f734208eda8367b04323c.tar.gz |
From 101 ways to panic your kernel.
Use bridge_ifdetach() to notify the bridge that a member has been detached. The
bridge can then remove it from its interface list and not try to send out via a
dead pointer.
Diffstat (limited to 'sys/net/if_ethersubr.c')
-rw-r--r-- | sys/net/if_ethersubr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 578ea99..8bce103 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -110,6 +110,7 @@ struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *); int (*bridge_output_p)(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); void (*bridge_dn_p)(struct mbuf *, struct ifnet *); +void (*bridge_detach_p)(struct ifnet *ifp); static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -909,6 +910,13 @@ ether_ifdetach(struct ifnet *ifp) ("ng_ether_detach_p is NULL")); (*ng_ether_detach_p)(ifp); } + + if (ifp->if_bridge) { + KASSERT(bridge_detach_p != NULL, + ("bridge_detach_p is NULL")); + (*bridge_detach_p)(ifp); + } + bpfdetach(ifp); if_detach(ifp); } |