diff options
author | 2009-08-12 21:44:49 +0000 | |
---|---|---|
committer | 2009-08-12 21:44:49 +0000 | |
commit | 11adecbe248d43c5741fc78a7b813972a3fb056d (patch) | |
tree | 8f4f5000c000c9e44eafb10c9b5e968d23679e5a | |
parent | only pull in the source file if it is needed, so that all the others (diff) | |
download | wireguard-openbsd-11adecbe248d43c5741fc78a7b813972a3fb056d.tar.xz wireguard-openbsd-11adecbe248d43c5741fc78a7b813972a3fb056d.zip |
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); } |