From c9dd371765b34cf81049f96631105d0068d2fa4e Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Tue, 2 Jun 2009 18:53:21 +0000 Subject: [PATCH] move ifq_detach from if_detach to if_free; this permits callers to reference if_snd in the period between detach+free which helps simplify detach code Reviewed by: jhb, rwatson --- sys/net/if.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 9a3c1fdedf3a..ffff619d2794 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -574,6 +574,7 @@ if_free_internal(struct ifnet *ifp) knlist_destroy(&ifp->if_klist); IF_AFDATA_DESTROY(ifp); IF_ADDR_LOCK_DESTROY(ifp); + ifq_detach(&ifp->if_snd); free(ifp, M_IFNET); } @@ -1025,9 +1026,6 @@ if_detach_internal(struct ifnet *ifp, int vmove) } ifp->if_afdata_initialized = 0; IF_AFDATA_UNLOCK(ifp); - - if (!vmove) - ifq_detach(&ifp->if_snd); } #ifdef VIMAGE