]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ipv4: Minor logic clean-up in ipv4_mtu
authorAlexander Duyck <alexander.h.duyck@intel.com>
Mon, 27 Aug 2012 06:30:01 +0000 (06:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Aug 2012 20:22:50 +0000 (16:22 -0400)
In ipv4_mtu there is some logic where we are testing for a non-zero value
and a timer expiration, then setting the value to zero, and then testing if
the value is zero we set it to a value based on the dst.  Instead of
bothering with the extra steps it is easier to just cleanup the logic so
that we set it to the dst based value if it is zero or if the timer has
expired.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
net/ipv4/route.c

index d2d1e153e7c49d08c87a6b7750d3bd4bf013d5f6..dc9549b5eb1c8be11c6997e460ffb517a8b06bb3 100644 (file)
@@ -1134,10 +1134,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
        const struct rtable *rt = (const struct rtable *) dst;
        unsigned int mtu = rt->rt_pmtu;
 
-       if (mtu && time_after_eq(jiffies, rt->dst.expires))
-               mtu = 0;
-
-       if (!mtu)
+       if (!mtu || time_after_eq(jiffies, rt->dst.expires))
                mtu = dst_metric_raw(dst, RTAX_MTU);
 
        if (mtu && rt_is_output_route(rt))