diff options
author | 2010-12-11 21:07:38 +0000 | |
---|---|---|
committer | 2010-12-11 21:07:38 +0000 | |
commit | 882a6c1671663ece14859d266d857073723875ca (patch) | |
tree | 1ccbfd6e5b1f5bfd61a2f4bc5a75ea73dbb89aa9 | |
parent | rsu(4), a driver for Realtek RTL8188SU, RTL8191SU and RTL8192SU (diff) | |
download | wireguard-openbsd-882a6c1671663ece14859d266d857073723875ca.tar.xz wireguard-openbsd-882a6c1671663ece14859d266d857073723875ca.zip |
drop Rx'd frames larger than MCLBYTES.
-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; } |