Use revoke_and_destroy_dev() instead of destroy_dev() when removing /dev/net

pseudo-devices when an interface goes away.  Otherwise, an open /dev/net/foo0
when the interface is removed can cause a crash.

Not objected to by:	jlemon
This commit is contained in:
Brian Feldman 2002-03-05 17:50:35 +00:00
parent 04858e7ee4
commit 0346e9733a

View File

@ -462,7 +462,7 @@ if_detach(ifp)
* Clean up all addresses.
*/
ifaddr_byindex(ifp->if_index) = NULL;
destroy_dev(ifdev_byindex(ifp->if_index));
revoke_and_destroy_dev(ifdev_byindex(ifp->if_index));
ifdev_byindex(ifp->if_index) = NULL;
while (if_index > 0 && ifaddr_byindex(if_index) == NULL)