From 5d40d65b5a4dc7305f8f4bde7c10d5cbb2329654 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Fri, 9 Sep 2005 08:41:39 +0000 Subject: [PATCH] When a carp(4) interface is being destroyed and is in a promiscous mode, first interface is detached from parent and then bpfdetach() is called. If the interface was the last carp(4) interface attached to parent, then the mutex on parent is destroyed. When bpfdetach() calls if_setflags() we panic on destroyed mutex. To prevent the above scenario, clear pointer to parent, when we detach ourselves from parent. --- sys/netinet/ip_carp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 606bf1c93179..7dd72c17eb12 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -443,6 +443,7 @@ carp_clone_destroy(struct ifnet *ifp) CARP_LOCK_DESTROY(cif); FREE(cif, M_CARP); ifpromisc(sc->sc_carpdev, 0); + sc->sc_carpdev = NULL; } else { CARP_UNLOCK(cif); }