Author: hselasky
Date: Fri Sep 28 15:33:13 2012
New Revision: 241033
URL: http://svn.freebsd.org/changeset/base/241033

Log:
  Remove some trailing bytes which are not part of the ethernet packet.
  
  Discussed with:               bgray @

Modified:
  head/sys/dev/usb/net/if_smsc.c

Modified: head/sys/dev/usb/net/if_smsc.c
==============================================================================
--- head/sys/dev/usb/net/if_smsc.c      Fri Sep 28 15:24:14 2012        
(r241032)
+++ head/sys/dev/usb/net/if_smsc.c      Fri Sep 28 15:33:13 2012        
(r241033)
@@ -1042,7 +1042,9 @@ smsc_bulk_read_callback(struct usb_xfer 
                                }
                        
                                /* 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 */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to