Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332920
b: refs/heads/master
c: ee9a8f7
h: refs/heads/master
v: v3
  • Loading branch information
Steffen Klassert authored and David S. Miller committed Oct 8, 2012
1 parent b3de3bb commit a0fa06e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7f92d334ba19a0d8e96f8f8f092219553367d921
refs/heads/master: ee9a8f7ab2edf801b8b514c310455c94acc232f6
19 changes: 11 additions & 8 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2187,8 +2187,18 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
nla_put_be32(skb, RTA_GATEWAY, rt->rt_gateway))
goto nla_put_failure;

expires = rt->dst.expires;
if (expires) {
unsigned long now = jiffies;

if (time_before(now, expires))
expires -= now;
else
expires = 0;
}

memcpy(metrics, dst_metrics_ptr(&rt->dst), sizeof(metrics));
if (rt->rt_pmtu)
if (rt->rt_pmtu && expires)
metrics[RTAX_MTU - 1] = rt->rt_pmtu;
if (rtnetlink_put_metrics(skb, metrics) < 0)
goto nla_put_failure;
Expand All @@ -2198,13 +2208,6 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src,
goto nla_put_failure;

error = rt->dst.error;
expires = rt->dst.expires;
if (expires) {
if (time_before(jiffies, expires))
expires -= jiffies;
else
expires = 0;
}

if (rt_is_input_route(rt)) {
if (nla_put_u32(skb, RTA_IIF, rt->rt_iif))
Expand Down

0 comments on commit a0fa06e

Please sign in to comment.