• Herbert Xu's avatar
    ipip: Fix handling of DF packets when pmtudisc is OFF · 23ca0c98
    Herbert Xu authored
    RFC 2003 requires the outer header to have DF set if DF is set
    on the inner header, even when PMTU discovery is off for the
    tunnel.  Our implementation does exactly that.
    
    For this to work properly the IPIP gateway also needs to engate
    in PMTU when the inner DF bit is set.  As otherwise the original
    host would not be able to carry out its PMTU successfully since
    part of the path is only visible to the gateway.
    
    Unfortunately when the tunnel PMTU discovery setting is off, we
    do not collect the necessary soft state, resulting in blackholes
    when the original host tries to perform PMTU discovery.
    
    This problem is not reproducible on the IPIP gateway itself as
    the inner packet usually has skb->local_df set.  This is not
    correctly cleared (an unrelated bug) when the packet passes
    through the tunnel, which allows fragmentation to occur.  For
    hosts behind the IPIP gateway it is readily visible with a simple
    ping.
    
    This patch fixes the problem by performing PMTU discovery for
    all packets with the inner DF bit set, regardless of the PMTU
    discovery setting on the tunnel itself.
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    23ca0c98
ipip.c 20.5 KB