ipv4: Fix PMTU update.
authorHiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Wed, 9 Mar 2011 20:09:58 +0000 (20:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Mar 2011 01:37:49 +0000 (18:37 -0700)
commit46af31800b6916c92fffa529dc3c357008da957d
tree2c66ee7b78527da504a294f1bd8a2a899623fead
parentbef55aebd560c5a6f8883c421abccee39978c58c
ipv4: Fix PMTU update.

On current net-next-2.6, when Linux receives ICMP Type: 3, Code: 4
(Destination unreachable (Fragmentation needed)),

  icmp_unreach
    -> ip_rt_frag_needed
         (peer->pmtu_expires is set here)
    -> tcp_v4_err
         -> do_pmtu_discovery
              -> ip_rt_update_pmtu
                   (peer->pmtu_expires is already set,
                    so check_peer_pmtu is skipped.)
                   -> check_peer_pmtu

check_peer_pmtu is skipped and MTU is not updated.

To fix this, let check_peer_pmtu execute unconditionally.
And some minor fixes
1) Avoid potential peer->pmtu_expires set to be zero.
2) In check_peer_pmtu, argument of time_before is reversed.
3) check_peer_pmtu expects peer->pmtu_orig is initialized as zero,
   but not initialized.

Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inetpeer.c
net/ipv4/route.c