diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-08-20 23:56:58 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-08-20 23:56:58 +0000 |
commit | 035fbb098d184a4e695502dcdfb78c5159f73f25 (patch) | |
tree | 8adde1aa81762ee32af33f21cf99e5bfb7a48767 /sys/dev | |
parent | ae1550d3e4288c23d6cf19fdd1d76c8b33969284 (diff) |
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
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_nfe.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 <damien.bergamini@free.fr> @@ -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); |