* Clean up mbuf (chain) from any tags and packet headers. * If "all" is set then the first mbuf in the chain will be * cleaned too. */
| 264 | * cleaned too. |
| 265 | */ |
| 266 | void |
| 267 | m_demote(struct mbuf *m0, int all, int flags) |
| 268 | { |
| 269 | struct mbuf *m; |
| 270 | |
| 271 | for (m = all ? m0 : m0->m_next; m != NULL; m = m->m_next) { |
| 272 | KASSERT(m->m_nextpkt == NULL, ("%s: m_nextpkt in m %p, m0 %p", |
| 273 | __func__, m, m0)); |
| 274 | if (m->m_flags & M_PKTHDR) |
| 275 | m_demote_pkthdr(m); |
| 276 | m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | |
| 277 | M_EXTPG | flags); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | /* |
| 282 | * Sanity checks on mbuf (chain) for use in KASSERT() and general |
no test coverage detected