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.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 5ab9973571ef..c17f8c0b933e 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1249,6 +1249,31 @@ int ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
1249 return ifp != NULL; 1249 return ifp != NULL;
1250} 1250}
1251 1251
1252int ipv6_chk_prefix(struct in6_addr *addr, struct net_device *dev)
1253{
1254 struct inet6_dev *idev;
1255 struct inet6_ifaddr *ifa;
1256 int onlink;
1257
1258 onlink = 0;
1259 rcu_read_lock();
1260 idev = __in6_dev_get(dev);
1261 if (idev) {
1262 read_lock_bh(&idev->lock);
1263 for (ifa = idev->addr_list; ifa; ifa = ifa->if_next) {
1264 onlink = ipv6_prefix_equal(addr, &ifa->addr,
1265 ifa->prefix_len);
1266 if (onlink)
1267 break;
1268 }
1269 read_unlock_bh(&idev->lock);
1270 }
1271 rcu_read_unlock();
1272 return onlink;
1273}
1274
1275EXPORT_SYMBOL(ipv6_chk_prefix);
1276
1252struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, struct in6_addr *addr, 1277struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, struct in6_addr *addr,
1253 struct net_device *dev, int strict) 1278 struct net_device *dev, int strict)
1254{ 1279{