PERFORCE change 129005 for review
Marko Zec
zec at FreeBSD.org
Mon Nov 12 16:25:27 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=129005
Change 129005 by zec at zec_tpx32 on 2007/11/13 00:24:48
When detaching an ifnet, attempt to detach from any vlan,
bridge, lagg or similar ifnets linked to us as early as
possible.
This fixes a panic that can be provoked as follows:
ngctl mkpeer eiface ether ether
ifconfig vlan create
ifconfig vlan0 vlan 1 vlandev ngeth0
ifconfig vlan0 10.0.0.1 up
ngctl shut ngeth0:
The panic is reproducible both in HEAD and vimage branch.
Reported by: Nikos Vassiliadis <nvass at teledomenet.gr>
Affected files ...
.. //depot/projects/vimage/src/sys/net/if.c#22 edit
Differences ...
==== //depot/projects/vimage/src/sys/net/if.c#22 (text+ko) ====
@@ -766,6 +766,14 @@
struct ifnet *iter;
int found = 0;
+ /*
+ * Detach from any vlan, bridge or lagg ifnets linked to us.
+ * A small though unlikely window for a race from here to ifp
+ * unlinking from ifnet list is possible, hence we repeat the
+ * procedure once again further bellow. XXX.
+ */
+ EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
+
IFNET_WLOCK();
TAILQ_FOREACH(iter, &V_ifnet, if_link)
if (iter == ifp) {
More information about the p4-projects
mailing list