diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2012-08-27 02:30:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-31 16:22:50 -0400 |
commit | 98d75c3724f9b37cdfdb85f821e10edcb743959e (patch) | |
tree | 1d5d9697fb34a5d2968fee815cdcc0de6f029576 /net/ipv4/route.c | |
parent | 4a2c240691bfdb9b08e680fb8af3f8c011c60e02 (diff) |
ipv4: Minor logic clean-up in ipv4_mtu
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>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index d2d1e153e7c4..dc9549b5eb1c 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1134,10 +1134,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst) | |||
1134 | const struct rtable *rt = (const struct rtable *) dst; | 1134 | const struct rtable *rt = (const struct rtable *) dst; |
1135 | unsigned int mtu = rt->rt_pmtu; | 1135 | unsigned int mtu = rt->rt_pmtu; |
1136 | 1136 | ||
1137 | if (mtu && time_after_eq(jiffies, rt->dst.expires)) | 1137 | if (!mtu || time_after_eq(jiffies, rt->dst.expires)) |
1138 | mtu = 0; | ||
1139 | |||
1140 | if (!mtu) | ||
1141 | mtu = dst_metric_raw(dst, RTAX_MTU); | 1138 | mtu = dst_metric_raw(dst, RTAX_MTU); |
1142 | 1139 | ||
1143 | if (mtu && rt_is_output_route(rt)) | 1140 | if (mtu && rt_is_output_route(rt)) |