Skip to content

Commit

Permalink
net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
Browse files Browse the repository at this point in the history
cdc_eem frames might need to contain 802.1Q VLAN Ethernet frames.
URB/skb sizing from usbnet will default to the hard_mtu,
so account for the VLAN header by expanding that via hard_header_len

Signed-off-by: Ian Coolidge <iancoolidge@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ian Coolidge authored and David S. Miller committed Nov 8, 2012
1 parent 4fe5f07 commit a66fe16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/usb/cdc_eem.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/usb/cdc.h>
#include <linux/usb/usbnet.h>
#include <linux/gfp.h>
#include <linux/if_vlan.h>


/*
Expand Down Expand Up @@ -92,7 +93,7 @@ static int eem_bind(struct usbnet *dev, struct usb_interface *intf)

/* no jumbogram (16K) support for now */

dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN;
dev->net->hard_header_len += EEM_HEAD + ETH_FCS_LEN + VLAN_HLEN;
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;

return 0;
Expand Down

0 comments on commit a66fe16

Please sign in to comment.