Date: Tue, 13 Nov 2007 00:25:26 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 129005 for review Message-ID: <200711130025.lAD0PQsM070391@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129005 Change 129005 by zec@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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711130025.lAD0PQsM070391>