Commit 967a4ea0 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji Committed by David S. Miller

[IPV4/IPV6]: Normalize jiffies reported to userspace in routing code.

parent 69a494d0
......@@ -89,6 +89,7 @@
#include <linux/random.h>
#include <linux/jhash.h>
#include <linux/rcupdate.h>
#include <linux/times.h>
#include <net/protocol.h>
#include <net/ip.h>
#include <net/route.h>
......@@ -2309,7 +2310,7 @@ static int rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event,
ci.rta_used = rt->u.dst.__use;
ci.rta_clntref = atomic_read(&rt->u.dst.__refcnt);
if (rt->u.dst.expires)
ci.rta_expires = rt->u.dst.expires - jiffies;
ci.rta_expires = jiffies_to_clock_t(rt->u.dst.expires - jiffies);
else
ci.rta_expires = 0;
ci.rta_error = rt->u.dst.error;
......
......@@ -27,6 +27,7 @@
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/times.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/net.h>
......@@ -717,7 +718,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh, void *_rtattr)
return -ENOMEM;
rt->u.dst.obsolete = -1;
rt->rt6i_expires = rtmsg->rtmsg_info;
rt->rt6i_expires = clock_t_to_jiffies(rtmsg->rtmsg_info);
if (nlh && (r = NLMSG_DATA(nlh))) {
rt->rt6i_protocol = r->rtm_protocol;
} else {
......@@ -1535,7 +1536,7 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt,
RTA_PUT(skb, RTA_PRIORITY, 4, &rt->rt6i_metric);
ci.rta_lastuse = jiffies - rt->u.dst.lastuse;
if (rt->rt6i_expires)
ci.rta_expires = rt->rt6i_expires - jiffies;
ci.rta_expires = jiffies_to_clock_t(rt->rt6i_expires - jiffies);
else
ci.rta_expires = 0;
ci.rta_used = rt->u.dst.__use;
......
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