diff mbox

sit: allow ip fragmentation when using nopmtudisc to fix package loss

Message ID 1251197322-3177-1-git-send-email-contact@saschahlusiak.de
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Sascha Hlusiak Aug. 25, 2009, 10:48 a.m. UTC
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 <contact@saschahlusiak.de>
---
 net/ipv6/sit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

David Miller Aug. 29, 2009, 6:54 a.m. UTC | #1
From: Sascha Hlusiak <contact@saschahlusiak.de>
Date: Tue, 25 Aug 2009 12:48:42 +0200

> 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 <contact@saschahlusiak.de>

Seems reasonable, applied to net-next-2.6, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;