summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2012-09-28 15:33:13 +0000
committerhselasky <hselasky@FreeBSD.org>2012-09-28 15:33:13 +0000
commitc416994d012d385bb5444861b0864d99ea6d5228 (patch)
tree2d75c4714d19d539c9cc677933a8af051daeca71
parentfc2bcd64bfef3e5d22929ced44a8e87cb462aa15 (diff)
downloadFreeBSD-src-c416994d012d385bb5444861b0864d99ea6d5228.zip
FreeBSD-src-c416994d012d385bb5444861b0864d99ea6d5228.tar.gz
Remove some trailing bytes which are not part of the ethernet packet.
Discussed with: bgray @
-rw-r--r--sys/dev/usb/net/if_smsc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c
index 6c9f60f..5f2acfb 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 */
OpenPOWER on IntegriCloud