Commit 8945a808 authored by Sascha Hlusiak's avatar Sascha Hlusiak Committed by David S. Miller

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

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: default avatarSascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30038fc6
...@@ -778,7 +778,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -778,7 +778,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
iph->version = 4; iph->version = 4;
iph->ihl = sizeof(struct iphdr)>>2; iph->ihl = sizeof(struct iphdr)>>2;
if (mtu > IPV6_MIN_MTU) if (mtu > IPV6_MIN_MTU)
iph->frag_off = htons(IP_DF); iph->frag_off = tiph->frag_off;
else else
iph->frag_off = 0; iph->frag_off = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment