Skip to content

Commit

Permalink
net: skb_vlan_untag(): don't reset transport offset if set by GRO layer
Browse files Browse the repository at this point in the history
Similar to commit fda55ec
("net: introduce skb_transport_header_was_set()"), avoid resetting
transport offsets that were already set by GRO layer. This not only
mirrors the behavior of __netif_receive_skb_core(), but also makes
sense when it comes to UDP GSO fraglists forwarding: transport offset
of such skbs is set only once by GRO receive callback and remains
untouched and correct up to the xmitting driver in 1:1 case, but
becomes junk after untagging in ingress VLAN case and breaks UDP
GSO offload. This does not happen after this change, and all types
of forwarding of UDP GSO fraglists work as expected.

Since v1 [1]:
 - keep the code 1:1 with __netif_receive_skb_core() (Jakub).

[1] https://lore.kernel.org/netdev/[email protected]

Signed-off-by: Alexander Lobakin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
solbjorn authored and kuba-moo committed Nov 10, 2020
1 parent 52643b7 commit 8be33ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -5441,7 +5441,8 @@ struct sk_buff *skb_vlan_untag(struct sk_buff *skb)
goto err_free;

skb_reset_network_header(skb);
skb_reset_transport_header(skb);
if (!skb_transport_header_was_set(skb))
skb_reset_transport_header(skb);
skb_reset_mac_len(skb);

return skb;
Expand Down

0 comments on commit 8be33ec

Please sign in to comment.