diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2008-04-03 16:39:55 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2008-04-03 16:39:55 +0000 |
commit | 98d609ca8290be5bdd34d21f9325e7a8eb766aad (patch) | |
tree | 67bbaea8cbc22ea9e5d5de426460225949f0506c /sys | |
parent | 4aa31bebd8ac9df2565106917ddc90f41e11f432 (diff) |
Ensure that we wrap around to the start of the TXD buffer when incrementing
the TXD pointer beyond the end.
Fixes PR5786.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_lii.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c index 9b4ae4fe046..df19def4fb0 100644 --- a/sys/dev/pci/if_lii.c +++ b/sys/dev/pci/if_lii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lii.c,v 1.9 2008/03/30 14:17:48 jsing Exp $ */ +/* $OpenBSD: if_lii.c,v 1.10 2008/04/03 16:39:54 jsing Exp $ */ /* * Copyright (c) 2007 The NetBSD Foundation. @@ -728,7 +728,7 @@ atl2_tx_put(struct atl2_softc *sc, struct mbuf *m) } /* Round to a 32-bit boundary */ - sc->sc_txd_cur = (sc->sc_txd_cur + 3) & ~3; + sc->sc_txd_cur = ((sc->sc_txd_cur + 3) & ~3) % AT_TXD_BUFFER_SIZE; if (sc->sc_txd_cur == sc->sc_txd_ack) sc->sc_free_tx_slots = 0; } |