IPv4 Fragmentation in a IPIP6 tunnel

Pietro Paolini pulsarpietro at aol.com
Wed Oct 30 11:02:18 EDT 2013


Hello everyone,
I am working for an embedded Linux firmware running on a CPE and I am 
using an IP4 over IPv6 tunnel configured as following:

ip -f inet6 tunnel add tun1 mode ipip6 remote XX:XX:XX local XX:XX:XX 
dev eth0

And it works fine until I don't try to test the fragment case: I send a 
too big UDP packet and my expectation - and requirement (sob) - would 
be a IPv6 packet fragmentation but what  I get is a double 
fragmentation (IPv4 and IPv6), then, summarizing:

IPv4 --> [IPv4-1-segment][IPv6] [IPv4-2-segment][IPv6]

Looking at the kernel code - which in I am not an expert - I observed 
that the function ip_finish_output :

#if defined(CONFIG_NETFILTER) && defined(CONFIG_XFRM)
        /* Policy lookup after SNAT yielded a new policy */
        if (skb_dst(skb)->xfrm != NULL) {
                IPCB(skb)->flags |= IPSKB_REROUTED;
                return dst_output(skb);
        }
#endif
#if defined(CONFIG_INET_IPSEC_OFFLOAD)
        if ((skb->ipsec_offload == 0) &&
                skb->len > ip_skb_dst_mtu(skb) && !skb_is_gso(skb))
#else
        if (skb->len > ip_skb_dst_mtu(skb) && !skb_is_gso(skb))
#endif
                return ip_fragment(skb, ip_finish_output2);
        else
                return ip_finish_output2(skb);

Does not care about it, it just fragments if the MTU does not match.

Is there any options to disable the fragmentation on IPV4  ? I am 
misconfiguring something ? Why does the ipip6 has this wrong behavior ?

Thanks in advance,
Pietro.

Pietro Paolini
pulsarpietro at aol.com




More information about the Kernelnewbies mailing list