From 3eebc6af8e34b225bed1c37a778ce7f61cc59e84 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 26 Sep 2007 13:10:00 +0000 Subject: ep(4) is totally weird. due to hardware design limitations it plays wierd games with caching mbufs. as part of that it used regular mbufs and makes them M_PKTHDR mbufs on the fly, instead of calling m_gethdr. of course it did it hackish and wrong and did not properly initialize the pkthdr fields, which stated to cause problems as soon as we started to stuff more into the packet header. so use the freshly introduced m_inithdr() to make the mbuf a pktdr mbuf. problem found + analyzed by janjaap@stack.nl PR5563, input theo, ok claudio --- sys/dev/ic/elink3.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sys/dev/ic') diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c index a377a9e5fca..09de8d648a5 100644 --- a/sys/dev/ic/elink3.c +++ b/sys/dev/ic/elink3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elink3.c,v 1.69 2007/01/19 01:33:44 krw Exp $ */ +/* $OpenBSD: elink3.c,v 1.70 2007/09/26 13:09:59 henning Exp $ */ /* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */ /* @@ -1389,10 +1389,7 @@ epget(sc, totlen) timeout_add(&sc->sc_epmbuffill_tmo, 1); /* Convert one of our saved mbuf's. */ sc->next_mb = (sc->next_mb + 1) % MAX_MBS; - m->m_data = m->m_pktdat; - m->m_flags = M_PKTHDR; - m_tag_init(m); - m->m_pkthdr.csum_flags = 0; + m = m_inithdr(m); } m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = totlen; -- cgit v1.2.3