From aecb98c94d19db859b293374cb1fc98dc202bc64 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 20 Sep 2005 13:37:17 +0000 Subject: [PATCH] Check IFF_DRV_RUNNING and presense of packets in queue before calling em_start_locked(). This fixes panic on shutdown with active traffic passing through router. Sponsored by: Rambler --- sys/dev/em/if_em.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index 3fa1180d050e..9d1a7452666f 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -644,7 +644,9 @@ em_start(struct ifnet *ifp) struct adapter *adapter = ifp->if_softc; EM_LOCK(adapter); - em_start_locked(ifp); + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + em_start_locked(ifp); EM_UNLOCK(adapter); return; }