diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2011-03-16 07:39:23 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2011-03-16 07:39:23 +0000 |
commit | b96b9773cdefa1c43255146055d177da5925d6e1 (patch) | |
tree | 8f4986fabd49674bef19485609a6e0a2feede177 /sys/dev/usb | |
parent | ac8276e8f049d1323bd110ca79275a92a3228297 (diff) |
If we get a packet larger than if_hardmtu skip it.
Tweaked version of a diff from Loganaden Velvindron
who sees a large garbage frame on his device.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_udav.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index f99a516c113..513e73984a5 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.51 2011/01/25 20:03:35 jakemsr Exp $ */ +/* $OpenBSD: if_udav.c,v 1.52 2011/03/16 07:39:22 jsg Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -1138,7 +1138,8 @@ udav_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) goto done; } - if (total_len < sizeof(struct ether_header) || + if (total_len < ETHERMIN || + total_len > ifp->if_hardmtu || h->pktstat & UDAV_RSR_ERR) { ifp->if_ierrors++; goto done; |