From 967a4ea0e840e156b106e15157d9a5200d37bc41 Mon Sep 17 00:00:00 2001 From: Hideaki Yoshifuji Date: Sun, 9 Nov 2003 03:26:59 -0800 Subject: [PATCH] [IPV4/IPV6]: Normalize jiffies reported to userspace in routing code. --- net/ipv4/route.c | 3 ++- net/ipv6/route.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 5dc5e3f426f0a..e648d21c7d0d8 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -89,6 +89,7 @@ #include #include #include +#include #include #include #include @@ -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; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index eb2e0fa516303..6c3d20c90ab02 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -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; -- 2.53.0