Skip to content

Commit

Permalink
ipv4: Minor logic clean-up in ipv4_mtu
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Aug 31, 2012
1 parent 4a2c240 commit 98d75c3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 98d75c3

Please sign in to comment.