diff options
author | David S. Miller <davem@davemloft.net> | 2010-11-19 16:13:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-19 16:13:47 -0500 |
commit | 24912420e923d56461b400d83f250a31bed8a964 (patch) | |
tree | 3bb599e665ed7510df2e3f4c8cb008f7a33f50a9 /net/ipv6 | |
parent | 0670b8ae66daf1d326c7bd10e73daff5f18fcf92 (diff) | |
parent | 0302b8622ce696af1cda22fcf207d3793350e896 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bonding/bond_main.c
net/core/net-sysfs.c
net/ipv6/addrconf.c
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 470e7acb91df..4cf760598c2a 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 | ||
@@ -3798,8 +3800,10 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, | |||
3798 | array[DEVCONF_AUTOCONF] = cnf->autoconf; | 3800 | array[DEVCONF_AUTOCONF] = cnf->autoconf; |
3799 | array[DEVCONF_DAD_TRANSMITS] = cnf->dad_transmits; | 3801 | array[DEVCONF_DAD_TRANSMITS] = cnf->dad_transmits; |
3800 | array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits; | 3802 | array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits; |
3801 | array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval; | 3803 | array[DEVCONF_RTR_SOLICIT_INTERVAL] = |
3802 | array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay; | 3804 | jiffies_to_msecs(cnf->rtr_solicit_interval); |
3805 | array[DEVCONF_RTR_SOLICIT_DELAY] = | ||
3806 | jiffies_to_msecs(cnf->rtr_solicit_delay); | ||
3803 | array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version; | 3807 | array[DEVCONF_FORCE_MLD_VERSION] = cnf->force_mld_version; |
3804 | #ifdef CONFIG_IPV6_PRIVACY | 3808 | #ifdef CONFIG_IPV6_PRIVACY |
3805 | array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; | 3809 | array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; |
@@ -3813,7 +3817,8 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf, | |||
3813 | array[DEVCONF_ACCEPT_RA_PINFO] = cnf->accept_ra_pinfo; | 3817 | array[DEVCONF_ACCEPT_RA_PINFO] = cnf->accept_ra_pinfo; |
3814 | #ifdef CONFIG_IPV6_ROUTER_PREF | 3818 | #ifdef CONFIG_IPV6_ROUTER_PREF |
3815 | array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; | 3819 | array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; |
3816 | array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval; | 3820 | array[DEVCONF_RTR_PROBE_INTERVAL] = |
3821 | jiffies_to_msecs(cnf->rtr_probe_interval); | ||
3817 | #ifdef CONFIG_IPV6_ROUTE_INFO | 3822 | #ifdef CONFIG_IPV6_ROUTE_INFO |
3818 | array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen; | 3823 | array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen; |
3819 | #endif | 3824 | #endif |
@@ -3902,10 +3907,9 @@ static int inet6_fill_ifla6_attrs(struct sk_buff *skb, struct inet6_dev *idev) | |||
3902 | NLA_PUT_U32(skb, IFLA_INET6_FLAGS, idev->if_flags); | 3907 | NLA_PUT_U32(skb, IFLA_INET6_FLAGS, idev->if_flags); |
3903 | 3908 | ||
3904 | ci.max_reasm_len = IPV6_MAXPLEN; | 3909 | ci.max_reasm_len = IPV6_MAXPLEN; |
3905 | ci.tstamp = (__u32)(TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) / HZ * 100 | 3910 | ci.tstamp = cstamp_delta(idev->tstamp); |
3906 | + TIME_DELTA(idev->tstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); | 3911 | ci.reachable_time = jiffies_to_msecs(idev->nd_parms->reachable_time); |
3907 | ci.reachable_time = idev->nd_parms->reachable_time; | 3912 | ci.retrans_time = jiffies_to_msecs(idev->nd_parms->retrans_time); |
3908 | ci.retrans_time = idev->nd_parms->retrans_time; | ||
3909 | NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); | 3913 | NLA_PUT(skb, IFLA_INET6_CACHEINFO, sizeof(ci), &ci); |
3910 | 3914 | ||
3911 | nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32)); | 3915 | nla = nla_reserve(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(s32)); |