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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 9d9a3c6056fa..2316a4315a18 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -512,6 +512,7 @@ static void
512ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp) 512ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp)
513{ 513{
514 struct inet6_ifaddr *ifa, **ifap; 514 struct inet6_ifaddr *ifa, **ifap;
515 int ifp_scope = ipv6_addr_src_scope(&ifp->addr);
515 516
516 /* 517 /*
517 * Each device address list is sorted in order of scope - 518 * Each device address list is sorted in order of scope -
@@ -519,7 +520,7 @@ ipv6_link_dev_addr(struct inet6_dev *idev, struct inet6_ifaddr *ifp)
519 */ 520 */
520 for (ifap = &idev->addr_list; (ifa = *ifap) != NULL; 521 for (ifap = &idev->addr_list; (ifa = *ifap) != NULL;
521 ifap = &ifa->if_next) { 522 ifap = &ifa->if_next) {
522 if (ifp->scope > ifa->scope) 523 if (ifp_scope >= ipv6_addr_src_scope(&ifa->addr))
523 break; 524 break;
524 } 525 }
525 526