Index: if_cdce.c =================================================================== RCS file: /cvsroot/src/sys/dev/usb/if_cdce.c,v retrieving revision 1.47 diff -p -u -r1.47 if_cdce.c --- if_cdce.c 5 May 2019 03:17:54 -0000 1.47 +++ if_cdce.c 17 Jun 2019 10:10:46 -0000 @@ -271,6 +271,8 @@ cdce_attach(device_t parent, device_t se eaddr[5] = (uint8_t)(device_unit(sc->cdce_dev)); } + mutex_init(&sc->cdce_start_lock, MUTEX_DEFAULT, IPL_NONE); + s = splnet(); aprint_normal_dev(self, "address %s\n", ether_sprintf(eaddr)); @@ -326,6 +328,8 @@ cdce_detach(device_t self, int flags) sc->cdce_attached = 0; splx(s); + mutex_destroy(&sc->cdce_start_lock); + return 0; } @@ -338,12 +342,17 @@ cdce_start(struct ifnet *ifp) if (sc->cdce_dying || (ifp->if_flags & IFF_OACTIVE)) return; + mutex_enter(&sc->cdce_start_lock); + IFQ_POLL(&ifp->if_snd, m_head); - if (m_head == NULL) + if (m_head == NULL) { + mutex_exit(&sc->cdce_start_lock); return; + } if (cdce_encap(sc, m_head, 0)) { ifp->if_flags |= IFF_OACTIVE; + mutex_exit(&sc->cdce_start_lock); return; } @@ -353,6 +362,8 @@ cdce_start(struct ifnet *ifp) ifp->if_flags |= IFF_OACTIVE; + mutex_exit(&sc->cdce_start_lock); + ifp->if_timer = 6; }