From c64c1c76b4a4535458ed89328b2959bd338333b0 Mon Sep 17 00:00:00 2001 From: Archie Cobbs Date: Tue, 14 Mar 2000 20:49:27 +0000 Subject: [PATCH] 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 --- sys/sys/mbuf.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index cc7211fb80c0..bd9bd5cd65e5 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 { \