diff options
author | dim <dim@FreeBSD.org> | 2015-07-04 21:50:39 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-07-04 21:50:39 +0000 |
commit | 6f44bd3256388beb23fd03fdf43ad5d53cf43e29 (patch) | |
tree | 37590f5c697f4198fdddec33c58aefdef0a5f485 /sys/kern/uipc_mbuf.c | |
parent | cea4c167517a0678c7dbf92a0324088dcbac1035 (diff) | |
parent | 76b8ff88e56f9ad0639b7e23dd9d1128a0750026 (diff) | |
download | FreeBSD-src-6f44bd3256388beb23fd03fdf43ad5d53cf43e29.zip FreeBSD-src-6f44bd3256388beb23fd03fdf43ad5d53cf43e29.tar.gz |
Merge ^/head r284737 through r285152.
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index b77d476..c0c467c 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -420,6 +420,17 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) n->m_flags |= m->m_flags & M_RDONLY; } +void +m_demote_pkthdr(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + + m_tag_delete_chain(m, NULL); + m->m_flags &= ~M_PKTHDR; + bzero(&m->m_pkthdr, sizeof(struct pkthdr)); +} + /* * Clean up mbuf (chain) from any tags and packet headers. * If "all" is set then the first mbuf in the chain will be @@ -433,11 +444,8 @@ m_demote(struct mbuf *m0, int all, int flags) for (m = all ? m0 : m0->m_next; m != NULL; m = m->m_next) { KASSERT(m->m_nextpkt == NULL, ("%s: m_nextpkt in m %p, m0 %p", __func__, m, m0)); - if (m->m_flags & M_PKTHDR) { - m_tag_delete_chain(m, NULL); - m->m_flags &= ~M_PKTHDR; - bzero(&m->m_pkthdr, sizeof(struct pkthdr)); - } + if (m->m_flags & M_PKTHDR) + m_demote_pkthdr(m); m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | flags); } } |