From patchwork Tue Aug 25 10:48:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hlusiak X-Patchwork-Id: 32033 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 80E2FB7B61 for ; Tue, 25 Aug 2009 20:47:34 +1000 (EST) Received: by ozlabs.org (Postfix) id 720ECDDD1B; Tue, 25 Aug 2009 20:47:34 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 070D9DDD0B for ; Tue, 25 Aug 2009 20:47:34 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754771AbZHYKrV (ORCPT ); Tue, 25 Aug 2009 06:47:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754758AbZHYKrU (ORCPT ); Tue, 25 Aug 2009 06:47:20 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:54055 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754237AbZHYKrU (ORCPT ); Tue, 25 Aug 2009 06:47:20 -0400 Received: from localhost.localdomain ([78.52.120.164]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MKt72-1MftYb2xwV-000Cua; Tue, 25 Aug 2009 12:47:18 +0200 From: Sascha Hlusiak To: netdev@vger.kernel.org Cc: Sascha Hlusiak Subject: [PATCH] sit: allow ip fragmentation when using nopmtudisc to fix package loss Date: Tue, 25 Aug 2009 12:48:42 +0200 Message-Id: <1251197322-3177-1-git-send-email-contact@saschahlusiak.de> X-Mailer: git-send-email 1.6.4 X-Provags-ID: V01U2FsdGVkX1/PNgwH5VuMhlGMWjCZhZqjb/2gM/lyNGfV399 Tme6fcGzgwwvK0xYMTnFSlqO6apmqClRT5GeQulLyiFrcgVhOT U+N57avZUCc5XW+AY3JQpes9lK2w3ig Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org if tunnel parameters have frag_off set to IP_DF, pmtudisc on the ipv4 link will be performed by deriving the mtu from the ipv4 link and setting the DF-Flag of the encapsulating IPv4 Header. If fragmentation is needed on the way, the IPv4 pmtu gets adjusted, the ipv6 package will be resent eventually, using the new and lower mtu and everyone is happy. If the frag_off parameter is unset, the mtu for the tunnel will be derived from the tunnel device or the ipv6 pmtu, which might be higher than the ipv4 pmtu. In that case we must allow the fragmentation of the IPv4 packet because the IPv6 mtu wouldn't 'learn' from the adjusted IPv4 pmtu, resulting in frequent icmp_frag_needed and package loss on the IPv6 layer. This patch allows fragmentation when tunnel was created with parameter nopmtudisc, like in ipip/gre tunnels. Signed-off-by: Sascha Hlusiak --- net/ipv6/sit.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 98b7327..386f1e9 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -778,7 +778,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) iph->version = 4; iph->ihl = sizeof(struct iphdr)>>2; if (mtu > IPV6_MIN_MTU) - iph->frag_off = htons(IP_DF); + iph->frag_off = tiph->frag_off; else iph->frag_off = 0;