summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-02-25 04:26:12 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-02-25 04:26:12 +0000
commit7bfd5fea035a5dc189d0b79dc1258ff137f27a81 (patch)
tree5430160a97536338af0441281c46689d00575d64
parentbf3a9a1952b5bfe25b1637a3742e275e5f7db164 (diff)
clear m->m_pkthdr when changing mbuf type to M_PKTHDR.
without it, junk pointer in m->m_pkthdr.tdbi may bite us.
-rw-r--r--sys/dev/ic/elink3.c3
-rw-r--r--sys/netiso/tp_emit.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c
index b9eccaca299..0e01d583561 100644
--- a/sys/dev/ic/elink3.c
+++ b/sys/dev/ic/elink3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elink3.c,v 1.37 2000/02/02 18:47:01 deraadt Exp $ */
+/* $OpenBSD: elink3.c,v 1.38 2000/02/25 04:26:11 itojun Exp $ */
/* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */
/*
@@ -1245,6 +1245,7 @@ epget(sc, totlen)
sc->next_mb = (sc->next_mb + 1) % MAX_MBS;
m->m_data = m->m_pktdat;
m->m_flags = M_PKTHDR;
+ bzero(&m->m_pkthdr, sizeof(m->m_pkthdr));
}
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
diff --git a/sys/netiso/tp_emit.c b/sys/netiso/tp_emit.c
index dd06e957469..4c238648050 100644
--- a/sys/netiso/tp_emit.c
+++ b/sys/netiso/tp_emit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tp_emit.c,v 1.3 1996/04/21 22:29:43 deraadt Exp $ */
+/* $OpenBSD: tp_emit.c,v 1.4 2000/02/25 04:26:11 itojun Exp $ */
/* $NetBSD: tp_emit.c,v 1.8 1996/03/16 23:13:48 christos Exp $ */
/*-
@@ -199,6 +199,7 @@ tp_emit(dutype, tpcb, seq, eot, data)
m->m_nextpkt = MNULL;
m->m_data = m->m_pktdat;
m->m_flags = M_PKTHDR;
+ bzero(&m->m_pkthdr, sizeof(m->m_pkthdr));
}
} else {
MGETHDR(m, M_DONTWAIT, TPMT_TPHDR);