From patchwork Fri Mar 22 10:31:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amerigo Wang X-Patchwork-Id: 229961 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3E1EC2C00BE for ; Fri, 22 Mar 2013 21:32:03 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932200Ab3CVKbw (ORCPT ); Fri, 22 Mar 2013 06:31:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21280 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983Ab3CVKbu (ORCPT ); Fri, 22 Mar 2013 06:31:50 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2MAVjXC027437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 22 Mar 2013 06:31:45 -0400 Received: from cr0.redhat.com (vpn1-114-5.nay.redhat.com [10.66.114.5]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2MAVdn3009506; Fri, 22 Mar 2013 06:31:40 -0400 From: Cong Wang To: netdev@vger.kernel.org Cc: Pravin B Shelar , Eric Dumazet , "David S. Miller" , Cong Wang Subject: [PATCH net-next 1/2] ip_gre: increase inner ip header ID during segmentation Date: Fri, 22 Mar 2013 18:31:31 +0800 Message-Id: <1363948292-9902-1-git-send-email-amwang@redhat.com> In-Reply-To: <1363938600-26129-1-git-send-email-amwang@redhat.com> References: <1363938600-26129-1-git-send-email-amwang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Cong Wang According to the previous discussion [1] on netdev list, DaveM insists we should increase the IP header ID for each segmented packets. This patch fixes it. Cc: Pravin B Shelar Cc: Eric Dumazet Cc: "David S. Miller" Signed-off-by: Cong Wang 1. http://marc.info/?t=136384172700001&r=1&w=2 --- net/ipv4/gre.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c index 7a4c710..e20631c 100644 --- a/net/ipv4/gre.c +++ b/net/ipv4/gre.c @@ -125,8 +125,9 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, netdev_features_t enc_features; int ghl = GRE_HEADER_SECTION; struct gre_base_hdr *greh; + struct iphdr *iph; int mac_len = skb->mac_len; - int tnl_hlen; + int tnl_hlen, id; bool csum; if (unlikely(skb_shinfo(skb)->gso_type & @@ -170,6 +171,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, skb_set_network_header(skb, skb_inner_network_offset(skb)); skb->mac_len = skb_inner_network_offset(skb); + iph = ip_hdr(skb); + id = ntohs(iph->id); /* segment inner packet. */ enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); segs = skb_mac_gso_segment(skb, enc_features); @@ -179,6 +182,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, skb = segs; tnl_hlen = skb_tnl_header_len(skb); do { + iph = (struct iphdr *)skb->data; + iph->id = htons(id++); __skb_push(skb, ghl); if (csum) { __be32 *pcsum;