From d5aeb7794835a8eaaf76a7c3fefaeac145ae524d Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Fri, 14 Jun 2013 03:31:11 +0000 Subject: [PATCH] sys/dev/xen/netfront/netfront.c: In netif_free(), call ifmedia_removeall() after ether_ifdetach() so that bpf listeners are detached, any link state processing is completed, and there is no chance for external reference to media information. Suggested by: yongari MFC after: 1 week --- sys/dev/xen/netfront/netfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index f2dc3acf6f70..68b3bf9be826 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -2178,12 +2178,12 @@ netif_free(struct netfront_info *info) XN_UNLOCK(info); callout_drain(&info->xn_stat_ch); netif_disconnect_backend(info); - ifmedia_removeall(&info->sc_media); if (info->xn_ifp != NULL) { ether_ifdetach(info->xn_ifp); if_free(info->xn_ifp); info->xn_ifp = NULL; } + ifmedia_removeall(&info->sc_media); } static void