net: Reset encap_level to avoid resetting features on inner IP headers
authorAlexander Duyck <aduyck@mirantis.com>
Tue, 22 Mar 2016 23:18:07 +0000 (16:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Mar 2016 18:19:08 +0000 (14:19 -0400)
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")
Reported-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/gre_offload.c
net/ipv4/udp_offload.c

index dd031617160ae8ac4ad1ae0441665d3a1acc8651..c47539d04b88a78457e1f6badc5770cc931b469c 100644 (file)
@@ -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));
index 8007f73b8981be7e894849e4737d000da4436796..0ed2dafb7cc405e1003f6044d42701abd3969d63 100644 (file)
@@ -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));