addrconf.c (c0b8da1e7613a11ce7e44560aae507b62da1f846) addrconf.c (c15df306fc79c672573f1cc2ebdfcb32d7e68780)
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 1346 unchanged lines hidden (view full) ---

1355 __set_bit(i, score->scorebits);
1356 score->rule = i;
1357out:
1358 return ret;
1359}
1360
1361static int __ipv6_dev_get_saddr(struct net *net,
1362 struct ipv6_saddr_dst *dst,
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 1346 unchanged lines hidden (view full) ---

1355 __set_bit(i, score->scorebits);
1356 score->rule = i;
1357out:
1358 return ret;
1359}
1360
1361static int __ipv6_dev_get_saddr(struct net *net,
1362 struct ipv6_saddr_dst *dst,
1363 unsigned int prefs,
1364 const struct in6_addr *saddr,
1365 struct inet6_dev *idev,
1366 struct ipv6_saddr_score *scores,
1367 int hiscore_idx)
1368{
1369 struct ipv6_saddr_score *score = &scores[1 - hiscore_idx], *hiscore = &scores[hiscore_idx];
1370
1371 read_lock_bh(&idev->lock);
1372 list_for_each_entry(score->ifa, &idev->addr_list, if_list) {

--- 107 unchanged lines hidden (view full) ---

1480 dst.scope <= IPV6_ADDR_SCOPE_LINKLOCAL) {
1481 idev = __in6_dev_get(dst_dev);
1482 use_oif_addr = true;
1483 }
1484 }
1485
1486 if (use_oif_addr) {
1487 if (idev)
1363 struct inet6_dev *idev,
1364 struct ipv6_saddr_score *scores,
1365 int hiscore_idx)
1366{
1367 struct ipv6_saddr_score *score = &scores[1 - hiscore_idx], *hiscore = &scores[hiscore_idx];
1368
1369 read_lock_bh(&idev->lock);
1370 list_for_each_entry(score->ifa, &idev->addr_list, if_list) {

--- 107 unchanged lines hidden (view full) ---

1478 dst.scope <= IPV6_ADDR_SCOPE_LINKLOCAL) {
1479 idev = __in6_dev_get(dst_dev);
1480 use_oif_addr = true;
1481 }
1482 }
1483
1484 if (use_oif_addr) {
1485 if (idev)
1488 hiscore_idx = __ipv6_dev_get_saddr(net, &dst, prefs, saddr, idev, scores, hiscore_idx);
1486 hiscore_idx = __ipv6_dev_get_saddr(net, &dst, idev, scores, hiscore_idx);
1489 } else {
1490 for_each_netdev_rcu(net, dev) {
1491 idev = __in6_dev_get(dev);
1492 if (!idev)
1493 continue;
1487 } else {
1488 for_each_netdev_rcu(net, dev) {
1489 idev = __in6_dev_get(dev);
1490 if (!idev)
1491 continue;
1494 hiscore_idx = __ipv6_dev_get_saddr(net, &dst, prefs, saddr, idev, scores, hiscore_idx);
1492 hiscore_idx = __ipv6_dev_get_saddr(net, &dst, idev, scores, hiscore_idx);
1495 }
1496 }
1497 rcu_read_unlock();
1498
1499 hiscore = &scores[hiscore_idx];
1500 if (!hiscore->ifa)
1501 return -EADDRNOTAVAIL;
1502

--- 4382 unchanged lines hidden ---
1493 }
1494 }
1495 rcu_read_unlock();
1496
1497 hiscore = &scores[hiscore_idx];
1498 if (!hiscore->ifa)
1499 return -EADDRNOTAVAIL;
1500

--- 4382 unchanged lines hidden ---