From 2cdf8c49a6997159bfa9f15873a6a58cd22f20c2 Mon Sep 17 00:00:00 2001 From: Marko Zec Date: Sat, 16 Jul 2011 19:11:45 +0000 Subject: [PATCH] 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 --- sys/netgraph/ng_ether.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index b51d04825e9a..afedaa37a8f7 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -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