aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-08 05:33:36 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-08 05:33:36 -0400
commit8eefca4888c986d993b2571eb31f0397a5d0a178 (patch)
treeadc659aba0eaaaaa3d33db20d7c759dfc5f0669b /net/ipv6/addrconf.c
parent549e028d012fab01e5726943d4afecd0c33d64e6 (diff)
parentde357cc01334a468e4d5b7ba66a17b0d3ca9d63e (diff)
Merge branch 'net-2.6.26-isatap-20080403' of git://git.linux-ipv6.org/gitroot/yoshfuji/linux-2.6-dev
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 dbc51af69017..924158393d04 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1265,6 +1265,31 @@ int ipv6_chk_same_addr(struct net *net, const struct in6_addr *addr,
1265 return ifp != NULL; 1265 return ifp != NULL;
1266} 1266}
1267 1267
1268int ipv6_chk_prefix(struct in6_addr *addr, struct net_device *dev)
1269{
1270 struct inet6_dev *idev;
1271 struct inet6_ifaddr *ifa;
1272 int onlink;
1273
1274 onlink = 0;
1275 rcu_read_lock();
1276 idev = __in6_dev_get(dev);
1277 if (idev) {
1278 read_lock_bh(&idev->lock);
1279 for (ifa = idev->addr_list; ifa; ifa = ifa->if_next) {
1280 onlink = ipv6_prefix_equal(addr, &ifa->addr,
1281 ifa->prefix_len);
1282 if (onlink)
1283 break;
1284 }
1285 read_unlock_bh(&idev->lock);
1286 }
1287 rcu_read_unlock();
1288 return onlink;
1289}
1290
1291EXPORT_SYMBOL(ipv6_chk_prefix);
1292
1268struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, struct in6_addr *addr, 1293struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, struct in6_addr *addr,
1269 struct net_device *dev, int strict) 1294 struct net_device *dev, int strict)
1270{ 1295{