Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935896AbcJ2NuO (ORCPT ); Sat, 29 Oct 2016 09:50:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49008 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933605AbcJ2NuL (ORCPT ); Sat, 29 Oct 2016 09:50:11 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Patrick Boutilier , Eric Dumazet , Jesse Gross , "David S. Miller" , Juerg Haefliger Subject: [PATCH 4.4 20/51] ipip: Properly mark ipip GRO packets as encapsulated. Date: Sat, 29 Oct 2016 09:49:21 -0400 Message-Id: <20161029134923.328224265@linuxfoundation.org> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161029134922.501052551@linuxfoundation.org> References: <20161029134922.501052551@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1734 Lines: 54 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jesse Gross 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 --- net/ipv4/af_inet.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- 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_off .callbacks = { .gso_segment = inet_gso_segment, .gro_receive = inet_gro_receive, - .gro_complete = inet_gro_complete, + .gro_complete = ipip_gro_complete, }, };