* Flush an interface queue. */
| 2327 | * Flush an interface queue. |
| 2328 | */ |
| 2329 | void |
| 2330 | if_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 |
no test coverage detected