Skip to contentSkip to conversation

net: Reset encap_level to avoid resetting features on inner IP headers

PATCH Applied Alexander Duyck 3 participants 3 messages Mar 22, 2016 – Mar 23, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: Reset encap_level to avoid resetting features on inner IP headers

This patch corrects an oversight in which we were allowing the encap_level value to pass from the outer headers to the inner headers. As a result we were incorrectly identifying UDP or GRE tunnels as also making use of ipip or sit when the second header actually represented a tunnel encapsulated in either a UDP or GRE tunnel which already had the features masked.

Fixes 76443456227097179c1482 ("net: Move GSO csum into SKB_GSO_CB")
---
 net/ipv4/gre_offload.c |    1 +
 net/ipv4/udp_offload.c |    1 +
 2 files changed, 2 insertions(+)
net/ipv4/gre_offload.c +1 -0
index dea0390d65bb..43a5c76742dc 100644
@@ -49,6 +49,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
 
 	/* setup inner skb. */
 	skb->encapsulation = 0;
+	SKB_GSO_CB(skb)->encap_level = 0;
 	__skb_pull(skb, tnl_hlen);
 	skb_reset_mac_header(skb);
 	skb_set_network_header(skb, skb_inner_network_offset(skb));
net/ipv4/udp_offload.c +1 -0
index 5fcb93269afb..80236a9e1769 100644
@@ -56,6 +56,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
 
 	/* setup inner skb. */
 	skb->encapsulation = 0;
+	SKB_GSO_CB(skb)->encap_level = 0;
 	__skb_pull(skb, tnl_hlen);
 	skb_reset_mac_header(skb);
 	skb_set_network_header(skb, skb_inner_network_offset(skb));
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Alexander Duyck

This patch corrects an oversight in which we were allowing the encap_level value to pass from the outer headers to the inner headers. As a result we were incorrectly identifying UDP or GRE tunnels as also making use of ipip or sit when the second header actually represented a tunnel encapsulated in either a UDP or GRE tunnel which already had the features masked.

Fixes 76443456227097179c1482 ("net: Move GSO csum into SKB_GSO_CB")

I do found it strange that we need to lie about the encap_level to get things to work. Hopefully, once the remaining encapsulation devices move to NETIF_HW_CSUM we can get rid of enc_features entirely.

Quoted 30 lines
---
 net/ipv4/gre_offload.c |    1 +
 net/ipv4/udp_offload.c |    1 +
 2 files changed, 2 insertions(+)
net/ipv4/gre_offload.c +1 -0
index dea0390d65bb..43a5c76742dc 100644
@@ -49,6 +49,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
 
        /* setup inner skb. */
        skb->encapsulation = 0;
+       SKB_GSO_CB(skb)->encap_level = 0;
        __skb_pull(skb, tnl_hlen);
        skb_reset_mac_header(skb);
        skb_set_network_header(skb, skb_inner_network_offset(skb));
net/ipv4/udp_offload.c +1 -0
index 5fcb93269afb..80236a9e1769 100644
@@ -56,6 +56,7 @@ static struct sk_buff *__skb_udp_tunnel_segment(struct sk_buff *skb,
 
        /* setup inner skb. */
        skb->encapsulation = 0;
+       SKB_GSO_CB(skb)->encap_level = 0;
        __skb_pull(skb, tnl_hlen);
        skb_reset_mac_header(skb);
        skb_set_network_header(skb, skb_inner_network_offset(skb));
maintainer Applied
#2 lore raw
In reply to Alexander Duyck

From: Alexander Duyck <[email protected]>
Date: Tue, 22 Mar 2016 16:18:07 -0700

Quoted 9 lines

This patch corrects an oversight in which we were allowing the encap_level value to pass from the outer headers to the inner headers. As a result we were incorrectly identifying UDP or GRE tunnels as also making use of ipip or sit when the second header actually represented a tunnel encapsulated in either a UDP or GRE tunnel which already had the features masked.

Fixes 76443456227097179c1482 ("net: Move GSO csum into SKB_GSO_CB")

Applied, thanks.