diff --git a/sys/net/if.c b/sys/net/if.c --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2183,6 +2183,14 @@ if (ifp->if_link_state == link_state) return; + /* + * if_detach_internal() drains the taskqueue_swi from the + * events from this ifnet. Maintain the invariant by + * refusing any changes after the interface was unlinked. + */ + if (ifp->if_flags & IFF_DYING) + return; + ifp->if_link_state = link_state; /* XXXGL: reference ifp? */