mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
o Remove the 'all' flag from m_demote(). Users can simply call it with
m_demote(m->m_next) if they wish to start at the second mbuf in chain. o Test m_type with == instead of &. o Check m_nextpkt against NULL instead of implicit 0. Based on feedback from: sam
This commit is contained in:
parent
86330afe35
commit
fbe816384a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149643
@ -271,11 +271,9 @@ mb_free_ext(struct mbuf *m)
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
void
|
||||
m_demote(struct mbuf *m0, int all)
|
||||
m_demote(struct mbuf *m0)
|
||||
{
|
||||
struct mbuf *m;
|
||||
|
||||
@ -285,9 +283,9 @@ m_demote(struct mbuf *m0, int all)
|
||||
m->m_flags &= ~M_PKTHDR;
|
||||
bzero(&m->m_pkthdr, sizeof(struct pkthdr));
|
||||
}
|
||||
if (m->m_type & MT_HEADER)
|
||||
if (m->m_type == MT_HEADER)
|
||||
m->m_type = MT_DATA;
|
||||
if (m != m0 && m->m_nextpkt)
|
||||
if (m != m0 && m->m_nextpkt != NULL)
|
||||
m->m_nextpkt = NULL;
|
||||
m->m_flags = m->m_flags & (M_EXT|M_EOR|M_RDONLY|M_FREELIST);
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ struct mbuf *m_copypacket(struct mbuf *, int);
|
||||
void m_copy_pkthdr(struct mbuf *, struct mbuf *);
|
||||
struct mbuf *m_copyup(struct mbuf *n, int len, int dstoff);
|
||||
struct mbuf *m_defrag(struct mbuf *, int);
|
||||
void m_demote(struct mbuf *, int);
|
||||
void m_demote(struct mbuf *);
|
||||
struct mbuf *m_devget(char *, int, int, struct ifnet *,
|
||||
void (*)(char *, caddr_t, u_int));
|
||||
struct mbuf *m_dup(struct mbuf *, int);
|
||||
|
Loading…
Reference in New Issue
Block a user