summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ti.c
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-09-16 00:55:10 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2004-09-16 00:55:10 +0000
commit52fe07878e4b37cae6d9ec07f548a31ffe6152b6 (patch)
tree08c9e6b4e215b8ab62068592406d9a56ea1a0412 /sys/dev/pci/if_ti.c
parent6494f05de83b84e20b911112563a4b97416c309c (diff)
If we can't allocate new jumbo storage, try to copy the packet into a
new mbuf chain with m_devget() before recycling the jumbo storage. Frome if_sk.c ok deraadt@
Diffstat (limited to 'sys/dev/pci/if_ti.c')
-rw-r--r--sys/dev/pci/if_ti.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c
index beee2005d7a..8e6bc404010 100644
--- a/sys/dev/pci/if_ti.c
+++ b/sys/dev/pci/if_ti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ti.c,v 1.53 2004/08/19 18:26:29 mcbride Exp $ */
+/* $OpenBSD: if_ti.c,v 1.54 2004/09/16 00:55:08 mcbride Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1844,10 +1844,18 @@ void ti_rxeof(sc)
ti_newbuf_jumbo(sc, sc->ti_jumbo, m);
continue;
}
- if (ti_newbuf_jumbo(sc, sc->ti_jumbo, NULL) == ENOBUFS) {
- ifp->if_ierrors++;
+ if (ti_newbuf_jumbo(sc, sc->ti_jumbo, NULL)
+ == ENOBUFS) {
+ struct mbuf *m0;
+ m0 = m_devget(mtod(m, char *) - ETHER_ALIGN,
+ cur_rx->ti_len + ETHER_ALIGN, 0, ifp, NULL);
ti_newbuf_jumbo(sc, sc->ti_jumbo, m);
- continue;
+ if (m0 == NULL) {
+ ifp->if_ierrors++;
+ continue;
+ }
+ m_adj(m0, ETHER_ALIGN);
+ m = m0;
}
} else if (cur_rx->ti_flags & TI_BDFLAG_MINI_RING) {
TI_INC(sc->ti_mini, TI_MINI_RX_RING_CNT);