From 66249c7c82f64f70b1cc7c7df5cf5cbadcd35ab8 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 28 Sep 2012 15:33:13 +0000 Subject: [PATCH] Remove some trailing bytes which are not part of the ethernet packet. Discussed with: bgray @ --- sys/dev/usb/net/if_smsc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c index 6c9f60f7f6a..5f2acfbad2c 100644 --- a/sys/dev/usb/net/if_smsc.c +++ b/sys/dev/usb/net/if_smsc.c @@ -1042,7 +1042,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) } /* Finally enqueue the mbuf on the receive queue */ - uether_rxmbuf(ue, m, pktlen); + /* Remove 4 trailing bytes */ + if (pktlen >= (4 + ETHER_HDR_LEN)) + uether_rxmbuf(ue, m, pktlen - 4); } /* Update the offset to move to the next potential packet */