MCPcopy Create free account
hub / github.com/F-Stack/f-stack / if_qflush

Function if_qflush

freebsd/net/if.c:2329–2350  ·  view source on GitHub ↗

* Flush an interface queue. */

Source from the content-addressed store, hash-verified

2327 * Flush an interface queue.
2328 */
2329void
2330if_qflush(struct ifnet *ifp)
2331{
2332 struct mbuf *m, *n;
2333 struct ifaltq *ifq;
2334
2335 ifq = &ifp->if_snd;
2336 IFQ_LOCK(ifq);
2337#ifdef ALTQ
2338 if (ALTQ_IS_ENABLED(ifq))
2339 ALTQ_PURGE(ifq);
2340#endif
2341 n = ifq->ifq_head;
2342 while ((m = n) != NULL) {
2343 n = m->m_nextpkt;
2344 m_freem(m);
2345 }
2346 ifq->ifq_head = 0;
2347 ifq->ifq_tail = 0;
2348 ifq->ifq_len = 0;
2349 IFQ_UNLOCK(ifq);
2350}
2351
2352/*
2353 * Map interface name to interface structure pointer, with or without

Callers 1

iflib_if_qflushFunction · 0.85

Calls 1

m_freemFunction · 0.50

Tested by

no test coverage detected