diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-02-05 21:48:00 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 2002-02-05 21:48:00 +0000 |
commit | 4478f14afdea56d58f9547b38719b075bc38fb15 (patch) | |
tree | 87395707594d6d5d7dfe4bbe907d9a1119c72c97 | |
parent | ed90c0e4e0768b03510effce8ed828b7a9d68229 (diff) |
Fix m_zero() yet again -- yesterday's fix wasn't sufficient.
-rw-r--r-- | sys/kern/uipc_mbuf.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 7bfa8b1fc3a..469cee8874b 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.51 2002/02/04 21:44:16 angelos Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.52 2002/02/05 21:47:59 angelos Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -905,11 +905,12 @@ m_zero(m) (m->m_ext.ext_free == NULL) && !MCLISREFERENCED(m)) memset(m->m_ext.ext_buf, 0, m->m_ext.ext_size); - if (m->m_flags & M_PKTHDR) - memset((caddr_t)m + sizeof(struct m_hdr) + - sizeof(struct pkthdr), 0, MHLEN); - else - memset((caddr_t)m + sizeof(struct m_hdr), 0, MLEN); + else { + if (m->m_flags & M_PKTHDR) + memset(m->m_pktdat, 0, MHLEN); + else + memset(m->m_dat, 0, MLEN); + } m = m->m_next; } } |