diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-09-29 16:04:07 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-09-29 16:04:07 +0000 |
commit | 5efd3c0a9754f1f08c7e94a8ce2256c17cc744f3 (patch) | |
tree | 20dce0a6bbfe2a6616587ef9cd7a7bc049f71ad4 /sys/dev | |
parent | 4183293558e99ea425774ebeb7a8badc70f84208 (diff) |
Discard packets in the receieve handler which are either too short
or too large.
From tsutsui@NetBSD
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 5f17a12d26d..b56e18821fe 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.51 2006/09/29 02:40:38 brad Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.52 2006/09/29 16:04:06 brad Exp $ */ /* * Copyright (c) 1997, 1998 @@ -633,7 +633,9 @@ rl_rxeof(sc) break; } - if (!(rxstat & RL_RXSTAT_RXOK)) { + if (!(rxstat & RL_RXSTAT_RXOK) || + total_len < ETHER_MIN_LEN || + total_len > ETHER_MAX_LEN) { ifp->if_ierrors++; rl_init(sc); bus_dmamap_sync(sc->sc_dmat, sc->sc_rx_dmamap, |