[PATCH] kern/95357: if_tap knlist of vmnet device is incorrectly destroyed by tapclose()

From: Maksim Yevmenkin <maksim.yevmenkin_at_savvis.net>
Date: Mon, 15 May 2006 14:56:59 -0700
dear hackers,

are there any objections to the attached patch?

could if_tap/vmnet users please give it a try to see if this fixes the 
panic on -current?

thanks,
max

--- if_tap.c.orig	Thu Mar 16 13:04:23 2006
+++ if_tap.c	Mon May 15 14:44:14 2006
_at__at_ -219,6 +219,7 _at__at_
 			KASSERT(!(tp->tap_flags & TAP_OPEN), 
 				("%s flags is out of sync", ifp->if_xname));
 
+			knlist_destroy(&tp->tap_rsel.si_note);
 			destroy_dev(tp->tap_dev);
 			s = splimp();
 			ether_ifdetach(ifp);
_at__at_ -354,6 +355,8 _at__at_
 	tp->tap_flags |= TAP_INITED;
 	mtx_unlock(&tp->tap_mtx);
 
+	knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL);
+
 	TAPDEBUG("interface %s is created. minor = %#x\n", 
 		ifp->if_xname, minor(dev));
 } /* tapcreate */
_at__at_ -405,8 +408,6 _at__at_
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
 	splx(s);
 
-	knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL);
-
 	TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, minor(dev));
 
 	return (0);
_at__at_ -458,8 +459,6 _at__at_
 	tp->tap_flags &= ~TAP_OPEN;
 	tp->tap_pid = 0;
 	mtx_unlock(&tp->tap_mtx);
-
-	knlist_destroy(&tp->tap_rsel.si_note);
 
 	TAPDEBUG("%s is closed. minor = %#x\n", 
 		ifp->if_xname, minor(dev));
Received on Mon May 15 2006 - 19:57:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:55 UTC