Subject: Re: linux-3.6+, gre+ipsec+forwarding = IP fragmentation broken

From: Timo Teras <[email-masked]>
Date: Fri, 15 Mar 2013 15:03:21 +0200

On Fri, 15 Mar 2013 13:38:20 +0200
Timo Teras <[email-masked]> wrote:

> [snip]
> Though, this implies that GSO cannot be used in ip_gre if ttl != inherit.
> 
> I added some ip_gre debugging and the following seems to happen:
> 
> - the mtu is calculated correctly on xmit path:
>   dst_mtu(&rt->dst) = 1458 (the tunnel's XFRMed IPv4 path)
> 
> - skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, skb, mtu);
>   is called with mtu=1430, which seems correct
> 
> - dst_mtu(skb_dst(skb)) seems to still return after above call the
>   value 1472 which is wrong. so update_pmtu is not working.
> 
> - skb->dev->ifindex implies skb->dev points to gre device when
>   update_pmtu is being called (and not the ethX from which the packet
>   was received), so ip_rt_update_pmtu() which eventually calls
>   build_skb_flow_key() is likely using wrong ifindex for the flow

One more observation is that the outer dst is an input route. And it
seems that input routes do not consult nexthop exception tables for
setting the rt_pmtu. Thus rt_pmtu is never set for forwarding entries.

- Timo