From: Jesse Gross Date: Sat, 19 Mar 2016 16:32:00 +0000 (-0700) Subject: ipip: Properly mark ipip GRO packets as encapsulated. X-Git-Tag: firefly_0821_release~176^2~4^2~21^2~35 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=419cabdcc4818dd06a1827e5e84df7738900a458;p=firefly-linux-kernel-4.4.55.git ipip: Properly mark ipip GRO packets as encapsulated. commit b8cba75bdf6a48ea4811bbefb11a94a5c7281b68 upstream. ipip encapsulated packets can be merged together by GRO but the result does not have the proper GSO type set or even marked as being encapsulated at all. Later retransmission of these packets will likely fail if the device does not support ipip offloads. This is similar to the issue resolved in IPv6 sit in feec0cb3 ("ipv6: gro: support sit protocol"). Reported-by: Patrick Boutilier Fixes: 9667e9bb ("ipip: Add gro callbacks to ipip offload") Tested-by: Patrick Boutilier Acked-by: Eric Dumazet Signed-off-by: Jesse Gross Signed-off-by: David S. Miller Signed-off-by: Juerg Haefliger Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 5c5db6636704..71be86e965e2 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1425,6 +1425,13 @@ out_unlock: return err; } +static int ipip_gro_complete(struct sk_buff *skb, int nhoff) +{ + skb->encapsulation = 1; + skb_shinfo(skb)->gso_type |= SKB_GSO_IPIP; + return inet_gro_complete(skb, nhoff); +} + int inet_ctl_sock_create(struct sock **sk, unsigned short family, unsigned short type, unsigned char protocol, struct net *net) @@ -1653,7 +1660,7 @@ static const struct net_offload ipip_offload = { .callbacks = { .gso_segment = inet_gso_segment, .gro_receive = inet_gro_receive, - .gro_complete = inet_gro_complete, + .gro_complete = ipip_gro_complete, }, };