diff options
Diffstat (limited to 'net/ipv6/anycast.c')
-rw-r--r-- | net/ipv6/anycast.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c index 463bd95d6b13..36e817492095 100644 --- a/net/ipv6/anycast.c +++ b/net/ipv6/anycast.c | |||
@@ -48,29 +48,6 @@ static int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); | |||
48 | /* Big ac list lock for all the sockets */ | 48 | /* Big ac list lock for all the sockets */ |
49 | static DEFINE_RWLOCK(ipv6_sk_ac_lock); | 49 | static DEFINE_RWLOCK(ipv6_sk_ac_lock); |
50 | 50 | ||
51 | static int | ||
52 | ip6_onlink(struct in6_addr *addr, struct net_device *dev) | ||
53 | { | ||
54 | struct inet6_dev *idev; | ||
55 | struct inet6_ifaddr *ifa; | ||
56 | int onlink; | ||
57 | |||
58 | onlink = 0; | ||
59 | rcu_read_lock(); | ||
60 | idev = __in6_dev_get(dev); | ||
61 | if (idev) { | ||
62 | read_lock_bh(&idev->lock); | ||
63 | for (ifa=idev->addr_list; ifa; ifa=ifa->if_next) { | ||
64 | onlink = ipv6_prefix_equal(addr, &ifa->addr, | ||
65 | ifa->prefix_len); | ||
66 | if (onlink) | ||
67 | break; | ||
68 | } | ||
69 | read_unlock_bh(&idev->lock); | ||
70 | } | ||
71 | rcu_read_unlock(); | ||
72 | return onlink; | ||
73 | } | ||
74 | 51 | ||
75 | /* | 52 | /* |
76 | * socket join an anycast group | 53 | * socket join an anycast group |
@@ -142,7 +119,7 @@ int ipv6_sock_ac_join(struct sock *sk, int ifindex, struct in6_addr *addr) | |||
142 | * This obviates the need for propagating anycast routes while | 119 | * This obviates the need for propagating anycast routes while |
143 | * still allowing some non-router anycast participation. | 120 | * still allowing some non-router anycast participation. |
144 | */ | 121 | */ |
145 | if (!ip6_onlink(addr, dev)) { | 122 | if (!ipv6_chk_prefix(addr, dev)) { |
146 | if (ishost) | 123 | if (ishost) |
147 | err = -EADDRNOTAVAIL; | 124 | err = -EADDRNOTAVAIL; |
148 | if (err) | 125 | if (err) |