From 4afbcfb67cfd32c3faafbc248e13b4e071772bee Mon Sep 17 00:00:00 2001 From: dlg Date: Wed, 20 Aug 2014 23:56:57 +0000 Subject: [PATCH] after allocating an mbuf and cluster you still need to init the length fields. found by steven roberts, who also tested this fix for me --- sys/dev/pci/if_nfe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index a8c1566ac0c..038e869d2e1 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nfe.c,v 1.106 2014/08/20 01:02:50 dlg Exp $ */ +/* $OpenBSD: if_nfe.c,v 1.107 2014/08/20 23:56:57 dlg Exp $ */ /*- * Copyright (c) 2006, 2007 Damien Bergamini @@ -717,6 +717,7 @@ nfe_rxeof(struct nfe_softc *sc) ifp->if_ierrors++; goto skip; } + mnew->m_pkthdr.len = mnew->m_len = MCLBYTES; bus_dmamap_sync(sc->sc_dmat, data->map, 0, data->map->dm_mapsize, BUS_DMASYNC_POSTREAD); @@ -1236,6 +1237,7 @@ nfe_alloc_rx_ring(struct nfe_softc *sc, struct nfe_rx_ring *ring) error = ENOMEM; goto fail; } + data->m->m_pkthdr.len = data->m->m_len = MCLBYTES; error = bus_dmamap_create(sc->sc_dmat, MCLBYTES, 1, MCLBYTES, 0, BUS_DMA_NOWAIT, &data->map); -- 2.20.1