svn commit: r250952 - head/sys/kern

Julian Elischer julian at FreeBSD.org
Fri May 24 02:18:38 UTC 2013


Author: julian
Date: Fri May 24 02:18:37 2013
New Revision: 250952
URL: http://svnweb.freebsd.org/changeset/base/250952

Log:
  Initialising the new fibnum field to a known value turns out to
  be a GOOD IDEA (TM).
  Apparently MOST users set this (e.g. tcp and friends) but there are a few
  users that just assume that it is a sensible value but then go on to read it.
  These include SCTP, pf and the FLOWTABLE option (and maybe others).

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Fri May 24 00:49:12 2013	(r250951)
+++ head/sys/kern/kern_mbuf.c	Fri May 24 02:18:37 2013	(r250952)
@@ -470,6 +470,7 @@ mb_ctor_mbuf(void *mem, int size, void *
 		m->m_pkthdr.tso_segsz = 0;
 		m->m_pkthdr.ether_vtag = 0;
 		m->m_pkthdr.flowid = 0;
+		m->m_pkthdr.fibnum = 0;
 		SLIST_INIT(&m->m_pkthdr.tags);
 #ifdef MAC
 		/* If the label init fails, fail the alloc */
@@ -695,6 +696,7 @@ mb_ctor_pack(void *mem, int size, void *
 		m->m_pkthdr.tso_segsz = 0;
 		m->m_pkthdr.ether_vtag = 0;
 		m->m_pkthdr.flowid = 0;
+		m->m_pkthdr.fibnum = 0;
 		SLIST_INIT(&m->m_pkthdr.tags);
 #ifdef MAC
 		/* If the label init fails, fail the alloc */
@@ -720,6 +722,7 @@ m_pkthdr_init(struct mbuf *m, int how)
 	m->m_pkthdr.header = NULL;
 	m->m_pkthdr.len = 0;
 	m->m_pkthdr.flowid = 0;
+	m->m_pkthdr.fibnum = 0;
 	m->m_pkthdr.csum_flags = 0;
 	m->m_pkthdr.csum_data = 0;
 	m->m_pkthdr.tso_segsz = 0;


More information about the svn-src-head mailing list