summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-03-14 20:49:27 +0000
committerarchie <archie@FreeBSD.org>2000-03-14 20:49:27 +0000
commit9318af6813e7321d6a2385841e1a87917cdb875b (patch)
treecefa7cc4ab704a1cd7e1e1ceb0328a2c9373eee1 /sys
parente7643a6c06b156cbc6af47ed8171c866dfd193e6 (diff)
downloadFreeBSD-src-9318af6813e7321d6a2385841e1a87917cdb875b.zip
FreeBSD-src-9318af6813e7321d6a2385841e1a87917cdb875b.tar.gz
Have MGETHDR() always initialize m->m_pkthdr.rcvif to NULL.
In the past, not doing this has caused several hard to find networking bugs, and the minor slowdown is deemed worthwhile. Reviewed by: wollman
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/mbuf.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index cc7211f..bd9bd5c 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -251,8 +251,6 @@ union mcluster {
* MGETHDR(struct mbuf *m, int how, int type)
* allocates an mbuf and initializes it to contain a packet header
* and internal data.
- *
- * Warning: MGETHDR() does *not* initialize m->m_pkthdr.rcvif.
*/
#define MGET(m, how, type) do { \
struct mbuf *_mm; \
@@ -302,6 +300,7 @@ union mcluster {
_mm->m_nextpkt = NULL; \
_mm->m_data = _mm->m_pktdat; \
_mm->m_flags = M_PKTHDR; \
+ _mm->m_pkthdr.rcvif = NULL; \
(m) = _mm; \
splx(_ms); \
} else { \
OpenPOWER on IntegriCloud