diff options
author | Daniel Lezcano <dlezcano@fr.ibm.com> | 2008-01-11 01:44:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:01:46 -0500 |
commit | 389f661224cdbdf178553fb09a52dc6c8bf86890 (patch) | |
tree | 710be1af4fd9a1173d9c6eae6da126872f9fd25c /net/ipv6/addrconf.c | |
parent | 1cab3da6be6c7659f62d0d297b389cc0e48b2178 (diff) |
[NETNS][IPV6]: inet6_addr - make ipv6_chk_home_addr namespace aware
Looks if the address is belonging to the network namespace, otherwise
discard the address for the check.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Benjamin Thery <benjamin.thery@bull.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c4df6cdff650..803caf1a3890 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2883,13 +2883,15 @@ void if6_proc_exit(void) | |||
2883 | 2883 | ||
2884 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) | 2884 | #if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) |
2885 | /* Check if address is a home address configured on any interface. */ | 2885 | /* Check if address is a home address configured on any interface. */ |
2886 | int ipv6_chk_home_addr(struct in6_addr *addr) | 2886 | int ipv6_chk_home_addr(struct net *net, struct in6_addr *addr) |
2887 | { | 2887 | { |
2888 | int ret = 0; | 2888 | int ret = 0; |
2889 | struct inet6_ifaddr * ifp; | 2889 | struct inet6_ifaddr * ifp; |
2890 | u8 hash = ipv6_addr_hash(addr); | 2890 | u8 hash = ipv6_addr_hash(addr); |
2891 | read_lock_bh(&addrconf_hash_lock); | 2891 | read_lock_bh(&addrconf_hash_lock); |
2892 | for (ifp = inet6_addr_lst[hash]; ifp; ifp = ifp->lst_next) { | 2892 | for (ifp = inet6_addr_lst[hash]; ifp; ifp = ifp->lst_next) { |
2893 | if (ifp->idev->dev->nd_net != net) | ||
2894 | continue; | ||
2893 | if (ipv6_addr_cmp(&ifp->addr, addr) == 0 && | 2895 | if (ipv6_addr_cmp(&ifp->addr, addr) == 0 && |
2894 | (ifp->flags & IFA_F_HOMEADDRESS)) { | 2896 | (ifp->flags & IFA_F_HOMEADDRESS)) { |
2895 | ret = 1; | 2897 | ret = 1; |