Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb if the pkt length in rx header is < ETHER_HDR_LE...
details: https://anonhg.NetBSD.org/src/rev/894e769d1fd3
branches: trunk
changeset: 332421:894e769d1fd3
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Sep 20 15:07:06 2014 +0000
description:
if the pkt length in rx header is < ETHER_HDR_LEN, drop it
diffstat:
sys/dev/usb/if_smsc.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (23 lines):
diff -r 80a3f78dbba6 -r 894e769d1fd3 sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c Sat Sep 20 11:16:05 2014 +0000
+++ b/sys/dev/usb/if_smsc.c Sat Sep 20 15:07:06 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_smsc.c,v 1.21 2014/09/14 21:06:12 jmcneill Exp $ */
+/* $NetBSD: if_smsc.c,v 1.22 2014/09/20 15:07:06 jmcneill Exp $ */
/* $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */
/* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -1304,6 +1304,13 @@
smsc_dbg_printf(sc, "rxeof total_len %d pktlen %d rxhdr "
"0x%08x\n", total_len, pktlen, rxhdr);
+ if (pktlen < ETHER_HDR_LEN) {
+ smsc_dbg_printf(sc, "pktlen %d < ETHER_HDR_LEN %d\n",
+ pktlen, ETHER_HDR_LEN);
+ ifp->if_ierrors++;
+ goto done;
+ }
+
pktlen += ETHER_ALIGN;
if (pktlen > MCLBYTES) {
Home |
Main Index |
Thread Index |
Old Index