]> git.baikalelectronics.ru Git - kernel.git/commitdiff
smsc95xx: strip ethernet fcs (crc) on receive path
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 13 May 2009 10:10:41 +0000 (10:10 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 May 2009 04:03:41 +0000 (21:03 -0700)
The smsc95xx driver was forwarding the trailing fcs on received frames
up the stack leading to confusion in tcpdump.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Tested-by: Steve Glendinning <steve.glendinning@smsc.com>
Acked-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/smsc95xx.c

index 5a7283372b53d09c9c4d39d6332fef471fde1875..89a91f8c22dea051009a1a2c513f28fa9a9b600f 100644 (file)
@@ -1134,7 +1134,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
                        if (skb->len == size) {
                                if (pdata->use_rx_csum)
                                        smsc95xx_rx_csum_offload(skb);
-
+                               skb_trim(skb, skb->len - 4); /* remove fcs */
                                skb->truesize = size + sizeof(struct sk_buff);
 
                                return 1;
@@ -1152,7 +1152,7 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 
                        if (pdata->use_rx_csum)
                                smsc95xx_rx_csum_offload(ax_skb);
-
+                       skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
                        ax_skb->truesize = size + sizeof(struct sk_buff);
 
                        usbnet_skb_return(dev, ax_skb);