ibmvnic: Account for VLAN tag in L2 Header descriptor
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Mon, 12 Mar 2018 16:51:02 +0000 (11:51 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Mar 2018 14:09:27 +0000 (10:09 -0400)
If a VLAN tag is present in the Ethernet header, account
for that when providing the L2 header to firmware.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index 7be4b06f69d2176f7946797973aafea69656ad60..ea9f351eb3438c303d54819299cfe98e0ff5b1f3 100644 (file)
@@ -1221,7 +1221,10 @@ static int build_hdr_data(u8 hdr_field, struct sk_buff *skb,
        int len = 0;
        u8 *hdr;
 
-       hdr_len[0] = sizeof(struct ethhdr);
+       if (skb_vlan_tagged(skb) && !skb_vlan_tag_present(skb))
+               hdr_len[0] = sizeof(struct vlan_ethhdr);
+       else
+               hdr_len[0] = sizeof(struct ethhdr);
 
        if (skb->protocol == htons(ETH_P_IP)) {
                hdr_len[1] = ip_hdr(skb)->ihl * 4;