diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2009-08-12 21:44:50 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2009-08-12 21:44:50 +0000 |
commit | 5d4bbcf644a8fab8f23f80ff07e893bb4965781e (patch) | |
tree | f27df33ab86c987e6d7a5ef3ba92949b8616403a | |
parent | 05858bcb4bb1168956cb036a9e89f8cfd2188857 (diff) |
just bzero the pkthdr instead of setting each and every member of that
struct to 0/NULL. no performance impact but way less error prone on
addition of new pkthdr field (as just ran into with a theo diff). ok theo
-rw-r--r-- | sys/kern/uipc_mbuf.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 26b61162ee6..96c3b2da5c5 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.132 2009/08/12 20:02:42 dlg Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.133 2009/08/12 21:44:49 henning Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -223,19 +223,7 @@ m_gethdr(int nowait, int type) m->m_nextpkt = (struct mbuf *)NULL; m->m_data = m->m_pktdat; m->m_flags = M_PKTHDR; - m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.rdomain = 0; - SLIST_INIT(&m->m_pkthdr.tags); - m->m_pkthdr.tagsset = 0; - m->m_pkthdr.csum_flags = 0; - m->m_pkthdr.ether_vtag = 0; - m->m_pkthdr.pf.hdr = NULL; - m->m_pkthdr.pf.statekey = NULL; - m->m_pkthdr.pf.rtableid = 0; - m->m_pkthdr.pf.qid = 0; - m->m_pkthdr.pf.tag = 0; - m->m_pkthdr.pf.flags = 0; - m->m_pkthdr.pf.routed = 0; + bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); } return (m); } @@ -248,19 +236,7 @@ m_inithdr(struct mbuf *m) m->m_nextpkt = (struct mbuf *)NULL; m->m_data = m->m_pktdat; m->m_flags = M_PKTHDR; - m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.rdomain = 0; - SLIST_INIT(&m->m_pkthdr.tags); - m->m_pkthdr.tagsset = 0; - m->m_pkthdr.csum_flags = 0; - m->m_pkthdr.ether_vtag = 0; - m->m_pkthdr.pf.hdr = NULL; - m->m_pkthdr.pf.statekey = NULL; - m->m_pkthdr.pf.rtableid = 0; - m->m_pkthdr.pf.qid = 0; - m->m_pkthdr.pf.tag = 0; - m->m_pkthdr.pf.flags = 0; - m->m_pkthdr.pf.routed = 0; + bzero(&m->m_pkthdr, sizeof(m->m_pkthdr)); return (m); } |