Skip to content

Commit da75e3b

Browse files
tlfalcondavem330
authored andcommitted
ibmvnic: Account for VLAN tag in L2 Header descriptor
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9ba3204 commit da75e3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,10 @@ static int build_hdr_data(u8 hdr_field, struct sk_buff *skb,
12211221
int len = 0;
12221222
u8 *hdr;
12231223

1224-
hdr_len[0] = sizeof(struct ethhdr);
1224+
if (skb_vlan_tagged(skb) && !skb_vlan_tag_present(skb))
1225+
hdr_len[0] = sizeof(struct vlan_ethhdr);
1226+
else
1227+
hdr_len[0] = sizeof(struct ethhdr);
12251228

12261229
if (skb->protocol == htons(ETH_P_IP)) {
12271230
hdr_len[1] = ip_hdr(skb)->ihl * 4;

0 commit comments

Comments
 (0)