Commit 98d75c37 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

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: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
parent 4a2c2406
...@@ -1134,10 +1134,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst) ...@@ -1134,10 +1134,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
const struct rtable *rt = (const struct rtable *) dst; const struct rtable *rt = (const struct rtable *) dst;
unsigned int mtu = rt->rt_pmtu; unsigned int mtu = rt->rt_pmtu;
if (mtu && time_after_eq(jiffies, rt->dst.expires)) if (!mtu || time_after_eq(jiffies, rt->dst.expires))
mtu = 0;
if (!mtu)
mtu = dst_metric_raw(dst, RTAX_MTU); mtu = dst_metric_raw(dst, RTAX_MTU);
if (mtu && rt_is_output_route(rt)) if (mtu && rt_is_output_route(rt))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment