diff options
-rw-r--r-- | net/ipv4/route.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 741df67a81ec..132e0dfee53a 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2187,8 +2187,18 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, | |||
2187 | nla_put_be32(skb, RTA_GATEWAY, rt->rt_gateway)) | 2187 | nla_put_be32(skb, RTA_GATEWAY, rt->rt_gateway)) |
2188 | goto nla_put_failure; | 2188 | goto nla_put_failure; |
2189 | 2189 | ||
2190 | expires = rt->dst.expires; | ||
2191 | if (expires) { | ||
2192 | unsigned long now = jiffies; | ||
2193 | |||
2194 | if (time_before(now, expires)) | ||
2195 | expires -= now; | ||
2196 | else | ||
2197 | expires = 0; | ||
2198 | } | ||
2199 | |||
2190 | memcpy(metrics, dst_metrics_ptr(&rt->dst), sizeof(metrics)); | 2200 | memcpy(metrics, dst_metrics_ptr(&rt->dst), sizeof(metrics)); |
2191 | if (rt->rt_pmtu) | 2201 | if (rt->rt_pmtu && expires) |
2192 | metrics[RTAX_MTU - 1] = rt->rt_pmtu; | 2202 | metrics[RTAX_MTU - 1] = rt->rt_pmtu; |
2193 | if (rtnetlink_put_metrics(skb, metrics) < 0) | 2203 | if (rtnetlink_put_metrics(skb, metrics) < 0) |
2194 | goto nla_put_failure; | 2204 | goto nla_put_failure; |
@@ -2198,13 +2208,6 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, | |||
2198 | goto nla_put_failure; | 2208 | goto nla_put_failure; |
2199 | 2209 | ||
2200 | error = rt->dst.error; | 2210 | error = rt->dst.error; |
2201 | expires = rt->dst.expires; | ||
2202 | if (expires) { | ||
2203 | if (time_before(jiffies, expires)) | ||
2204 | expires -= jiffies; | ||
2205 | else | ||
2206 | expires = 0; | ||
2207 | } | ||
2208 | 2211 | ||
2209 | if (rt_is_input_route(rt)) { | 2212 | if (rt_is_input_route(rt)) { |
2210 | if (nla_put_u32(skb, RTA_IIF, rt->rt_iif)) | 2213 | if (nla_put_u32(skb, RTA_IIF, rt->rt_iif)) |