diff options
-rw-r--r-- | net/ipv6/addrconf.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 52b7df74e4c7..2fc35b32df9e 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -98,7 +98,11 @@ | |||
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #define INFINITY_LIFE_TIME 0xFFFFFFFF | 100 | #define INFINITY_LIFE_TIME 0xFFFFFFFF |
101 | #define TIME_DELTA(a, b) ((unsigned long)((long)(a) - (long)(b))) | 101 | |
102 | static inline u32 cstamp_delta(unsigned long cstamp) | ||
103 | { | ||
104 | return (cstamp - INITIAL_JIFFIES) * 100UL / HZ; | ||
105 | } | ||
102 | 106 | ||
103 | #define ADDRCONF_TIMER_FUZZ_MINUS (HZ > 50 ? HZ/50 : 1) | 107 | #define ADDRCONF_TIMER_FUZZ_MINUS (HZ > 50 ? HZ/50 : 1) |
104 | #define ADDRCONF_TIMER_FUZZ (HZ / 4) | 108 | #define ADDRCONF_TIMER_FUZZ (HZ / 4) |
@@ -3444,10 +3448,8 @@ static int put_cacheinfo(struct sk_buff *skb, unsigned long cstamp, | |||
3444 | { | 3448 | { |
3445 | struct ifa_cacheinfo ci; | 3449 | struct ifa_cacheinfo ci; |
3446 | 3450 | ||
3447 | ci.cstamp = (u32)(TIME_DELTA(cstamp, INITIAL_JIFFIES) / HZ * 100 | 3451 | ci.cstamp = cstamp_delta(cstamp); |
3448 | + TIME_DELTA(cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); | 3452 | ci.tstamp = cstamp_delta(tstamp); |
3449 | ci.tstamp = (u32)(TIME_DELTA(tstamp, INITIAL_JIFFIES) / HZ * 100 | ||
3450 | + TIME_DELTA(tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); | ||
3451 | ci.ifa_prefered = preferred; | 3453 | ci.ifa_prefered = preferred; |
3452 | ci.ifa_valid = valid; | 3454 | ci.ifa_valid = valid; |
3453 | 3455 | ||
@@ -3932,10 +3934,9 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev, | |||
3932 | NLA_PUT_U32(skb, IFLA_INET6_FLAGS, idev->if_flags); | 3934 | NLA_PUT_U32(skb, IFLA_INET6_FLAGS, idev->if_flags); |
3933 | 3935 | ||
3934 | ci.max_reasm_len = IPV6_MAXPLEN; | 3936 | ci.max_reasm_len = IPV6_MAXPLEN; |
3935 | ci.tstamp = (__u32)(TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) / HZ * 100 | 3937 | ci.tstamp = cstamp_delta(idev->tstamp); |
3936 | + TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); | 3938 | ci.reachable_time = jiffies_to_msecs(idev->nd_parms->reachable_time); |
3937 | ci.reachable_time = idev->nd_parms->reachable_time; | 3939 | ci.retrans_time = jiffies_to_msecs(idev->nd_parms->retrans_time); |
3938 | ci.retrans_time = idev->nd_parms->retrans_time; | ||
3939 | NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); | 3940 | NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); |
3940 | 3941 | ||
3941 | nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32)); | 3942 | nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32)); |