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).
This commit is contained in:
Julian Elischer 2013-05-24 02:18:37 +00:00
parent 7639c9be45
commit 4591f0d339
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=250952

View File

@ -470,6 +470,7 @@ mb_ctor_mbuf(void *mem, int size, void *arg, int how)
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 *arg, int how)
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;