Index: sys/dev/xen/netfront/netfront.c =================================================================== --- sys/dev/xen/netfront/netfront.c +++ sys/dev/xen/netfront/netfront.c @@ -1705,7 +1705,7 @@ ifp = np->xn_ifp; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING || !netfront_carrier_ok(np)) return; xn_stop(np); @@ -2089,6 +2089,8 @@ np = ifp->if_softc; npairs = np->num_queues; + KASSERT(npairs != 0, ("called with 0 available queues")); + /* check if flowid is set */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) i = m->m_pkthdr.flowid % npairs; @@ -2203,9 +2205,9 @@ xn_stop(np); XN_UNLOCK(np); netif_disconnect_backend(np); + ether_ifdetach(np->xn_ifp); free(np->rxq, M_DEVBUF); free(np->txq, M_DEVBUF); - ether_ifdetach(np->xn_ifp); if_free(np->xn_ifp); np->xn_ifp = NULL; ifmedia_removeall(&np->sc_media);