diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-12-11 21:07:39 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-12-11 21:07:39 +0000 |
commit | 17a878d96f5d69c59e2a96a47595d3ae54675efb (patch) | |
tree | 462041c322937712445020ed31b3853e977d812f /sys/dev/usb | |
parent | ee22468d1bc04c55bf992ecc1999e83aa67e2415 (diff) |
drop Rx'd frames larger than MCLBYTES.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_urtwn.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c index 4eea4180ce5..68902fd7a33 100644 --- a/sys/dev/usb/if_urtwn.c +++ b/sys/dev/usb/if_urtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtwn.c,v 1.9 2010/12/11 13:27:27 damien Exp $ */ +/* $OpenBSD: if_urtwn.c,v 1.10 2010/12/11 21:07:38 damien Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -1486,8 +1486,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, uint8_t *buf, int pktlen) ifp->if_ierrors++; return; } - if (__predict_false(pktlen < sizeof(*wh))) { - ic->ic_stats.is_rx_tooshort++; + if (__predict_false(pktlen < sizeof(*wh) || pktlen > MCLBYTES)) { ifp->if_ierrors++; return; } |