svn commit: r224107 - head/sys/netgraph

Marko Zec zec at FreeBSD.org
Sat Jul 16 19:11:46 UTC 2011


Author: zec
Date: Sat Jul 16 19:11:45 2011
New Revision: 224107
URL: http://svn.freebsd.org/changeset/base/224107

Log:
  Clear pending ifnet events, in an attempt at preventing
  ng_ether_link_state() from being dispatched after we have
  cleared our IFP2NG(ifp).
  
  MFC after:	3 days

Modified:
  head/sys/netgraph/ng_ether.c

Modified: head/sys/netgraph/ng_ether.c
==============================================================================
--- head/sys/netgraph/ng_ether.c	Sat Jul 16 19:01:09 2011	(r224106)
+++ head/sys/netgraph/ng_ether.c	Sat Jul 16 19:11:45 2011	(r224107)
@@ -55,6 +55,7 @@
 #include <sys/proc.h>
 #include <sys/syslog.h>
 #include <sys/socket.h>
+#include <sys/taskqueue.h>
 
 #include <net/if.h>
 #include <net/if_dl.h>
@@ -336,6 +337,7 @@ ng_ether_detach(struct ifnet *ifp)
 	const node_p node = IFP2NG(ifp);
 	const priv_p priv = NG_NODE_PRIVATE(node);
 
+	taskqueue_drain(taskqueue_swi, &ifp->if_linktask);
 	NG_NODE_REALLY_DIE(node);	/* Force real removal of node */
 	/*
 	 * We can't assume the ifnet is still around when we run shutdown


More information about the svn-src-all mailing list