cdc-eem: bad crc checking
authorVincent CUISSARD <vincent.cuissard@gmail.com>
Thu, 16 Jul 2009 06:08:58 +0000 (06:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jul 2009 01:06:25 +0000 (18:06 -0700)
When the driver received an EEM packet with CRC option enabled, driver must
compute and check the CRC of the Ethernet data. Previous version computes CRC
on Ethernet data plus the original CRC value. Skbuff is correctly trimed but
the old length is used when CRC is computed.

Signed-off-by: Vincent CUISSARD <vincent.cuissard@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cdc_eem.c

index cd35d50..45cebfb 100644 (file)
@@ -311,7 +311,7 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
                         *      bmCRC = 0       : CRC = 0xDEADBEEF
                         */
                        if (header & BIT(14))
-                               crc2 = ~crc32_le(~0, skb2->data, len);
+                               crc2 = ~crc32_le(~0, skb2->data, skb2->len);
                        else
                                crc2 = 0xdeadbeef;