Message ID | 20230420225601.2358327-2-vladimir.oltean@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Commit | f90615ada0b1e21a9d93ff89b04549fd7a92c92b |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Remove skb_mac_header() dependency in DSA xmit path | expand |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 6864b89ef868..90b76d63c11c 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h @@ -351,7 +351,8 @@ static inline int __vlan_insert_inner_tag(struct sk_buff *skb, /* Move the mac header sans proto to the beginning of the new header. */ if (likely(mac_len > ETH_TLEN)) memmove(skb->data, skb->data + VLAN_HLEN, mac_len - ETH_TLEN); - skb->mac_header -= VLAN_HLEN; + if (skb_mac_header_was_set(skb)) + skb->mac_header -= VLAN_HLEN; veth = (struct vlan_ethhdr *)(skb->data + mac_len - ETH_HLEN);