We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9645b2 commit ae47457Copy full SHA for ae47457
net/core/skbuff.c
@@ -5028,8 +5028,10 @@ static struct sk_buff *skb_reorder_vlan_header(struct sk_buff *skb)
5028
}
5029
5030
mac_len = skb->data - skb_mac_header(skb);
5031
- memmove(skb_mac_header(skb) + VLAN_HLEN, skb_mac_header(skb),
5032
- mac_len - VLAN_HLEN - ETH_TLEN);
+ if (likely(mac_len > VLAN_HLEN + ETH_TLEN)) {
+ memmove(skb_mac_header(skb) + VLAN_HLEN, skb_mac_header(skb),
5033
+ mac_len - VLAN_HLEN - ETH_TLEN);
5034
+ }
5035
skb->mac_header += VLAN_HLEN;
5036
return skb;
5037
0 commit comments