Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 May 2006 14:56:59 -0700
From:      Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
To:        freebsd-current@freebsd.org
Subject:   [PATCH] kern/95357: if_tap knlist of vmnet device is incorrectly destroyed by tapclose()
Message-ID:  <4468F92B.90701@savvis.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------020208060901090307010900
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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

--------------020208060901090307010900
Content-Type: text/plain;
 name="if_tap.c.diff.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="if_tap.c.diff.txt"

--- if_tap.c.orig	Thu Mar 16 13:04:23 2006
+++ if_tap.c	Mon May 15 14:44:14 2006
@@ -219,6 +219,7 @@
 			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);
@@ -354,6 +355,8 @@
 	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 */
@@ -405,8 +408,6 @@
 	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);
@@ -458,8 +459,6 @@
 	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));

--------------020208060901090307010900--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4468F92B.90701>