diff options
author | Andre Oppermann <andre@FreeBSD.org> | 2005-08-30 20:07:49 +0000 |
---|---|---|
committer | Andre Oppermann <andre@FreeBSD.org> | 2005-08-30 20:07:49 +0000 |
commit | fbe816384a0f5235f0509d5f7d06903c678105e6 (patch) | |
tree | e5328ef2cb989bbdd52bd14657a08afebfd181c7 /sys | |
parent | 86330afe351b1e2f438892c8f931bcc21365b849 (diff) | |
download | src-fbe816384a0f5235f0509d5f7d06903c678105e6.tar.gz src-fbe816384a0f5235f0509d5f7d06903c678105e6.zip |
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
Notes
Notes:
svn path=/head/; revision=149643
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 8 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 18281fb22d91..4f66fe3d8e2b 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -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); } diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 7696fa4964eb..96de92026f9d 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -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); |