diff options
author | David S. Miller <davem@davemloft.net> | 2008-04-08 05:33:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-08 05:33:36 -0400 |
commit | 8eefca4888c986d993b2571eb31f0397a5d0a178 (patch) | |
tree | adc659aba0eaaaaa3d33db20d7c759dfc5f0669b /net/ipv6/addrconf.c | |
parent | 549e028d012fab01e5726943d4afecd0c33d64e6 (diff) | |
parent | de357cc01334a468e4d5b7ba66a17b0d3ca9d63e (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.c | 25 |
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 | ||
1268 | int 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 | |||
1291 | EXPORT_SYMBOL(ipv6_chk_prefix); | ||
1292 | |||
1268 | struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, struct in6_addr *addr, | 1293 | struct 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 | { |