aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d5fa5b8c443e..f62c72b59f8e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1671,7 +1671,7 @@ void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr)
1671static void addrconf_join_anycast(struct inet6_ifaddr *ifp) 1671static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
1672{ 1672{
1673 struct in6_addr addr; 1673 struct in6_addr addr;
1674 if (ifp->prefix_len == 127) /* RFC 6164 */ 1674 if (ifp->prefix_len >= 127) /* RFC 6164 */
1675 return; 1675 return;
1676 ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len); 1676 ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
1677 if (ipv6_addr_any(&addr)) 1677 if (ipv6_addr_any(&addr))
@@ -1682,7 +1682,7 @@ static void addrconf_join_anycast(struct inet6_ifaddr *ifp)
1682static void addrconf_leave_anycast(struct inet6_ifaddr *ifp) 1682static void addrconf_leave_anycast(struct inet6_ifaddr *ifp)
1683{ 1683{
1684 struct in6_addr addr; 1684 struct in6_addr addr;
1685 if (ifp->prefix_len == 127) /* RFC 6164 */ 1685 if (ifp->prefix_len >= 127) /* RFC 6164 */
1686 return; 1686 return;
1687 ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len); 1687 ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
1688 if (ipv6_addr_any(&addr)) 1688 if (ipv6_addr_any(&addr))
@@ -3456,7 +3456,12 @@ restart:
3456 &inet6_addr_lst[i], addr_lst) { 3456 &inet6_addr_lst[i], addr_lst) {
3457 unsigned long age; 3457 unsigned long age;
3458 3458
3459 if (ifp->flags & IFA_F_PERMANENT) 3459 /* When setting preferred_lft to a value not zero or
3460 * infinity, while valid_lft is infinity
3461 * IFA_F_PERMANENT has a non-infinity life time.
3462 */
3463 if ((ifp->flags & IFA_F_PERMANENT) &&
3464 (ifp->prefered_lft == INFINITY_LIFE_TIME))
3460 continue; 3465 continue;
3461 3466
3462 spin_lock(&ifp->lock); 3467 spin_lock(&ifp->lock);
@@ -3481,7 +3486,8 @@ restart:
3481 ifp->flags |= IFA_F_DEPRECATED; 3486 ifp->flags |= IFA_F_DEPRECATED;
3482 } 3487 }
3483 3488
3484 if (time_before(ifp->tstamp + ifp->valid_lft * HZ, next)) 3489 if ((ifp->valid_lft != INFINITY_LIFE_TIME) &&
3490 (time_before(ifp->tstamp + ifp->valid_lft * HZ, next)))
3485 next = ifp->tstamp + ifp->valid_lft * HZ; 3491 next = ifp->tstamp + ifp->valid_lft * HZ;
3486 3492
3487 spin_unlock(&ifp->lock); 3493 spin_unlock(&ifp->lock);
@@ -3761,7 +3767,8 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
3761 put_ifaddrmsg(nlh, ifa->prefix_len, ifa->flags, rt_scope(ifa->scope), 3767 put_ifaddrmsg(nlh, ifa->prefix_len, ifa->flags, rt_scope(ifa->scope),
3762 ifa->idev->dev->ifindex); 3768 ifa->idev->dev->ifindex);
3763 3769
3764 if (!(ifa->flags&IFA_F_PERMANENT)) { 3770 if (!((ifa->flags&IFA_F_PERMANENT) &&
3771 (ifa->prefered_lft == INFINITY_LIFE_TIME))) {
3765 preferred = ifa->prefered_lft; 3772 preferred = ifa->prefered_lft;
3766 valid = ifa->valid_lft; 3773 valid = ifa->valid_lft;
3767 if (preferred != INFINITY_LIFE_TIME) { 3774 if (preferred != INFINITY_LIFE_TIME) {