Gitweb:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=389f661224cdbdf178553fb09a52dc6c8bf86890
Commit: 389f661224cdbdf178553fb09a52dc6c8bf86890
Parent: 1cab3da6be6c7659f62d0d297b389cc0e48b2178
Author: Daniel Lezcano <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 22:44:40 2008 -0800
Committer: David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:01:46 2008 -0800
[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 <[EMAIL PROTECTED]>
Signed-off-by: Benjamin Thery <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
include/net/addrconf.h | 3 ++-
net/ipv6/addrconf.c | 4 +++-
net/ipv6/exthdrs.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 77f630f..8b1509b 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -65,7 +65,8 @@ extern int ipv6_chk_addr(struct net *net,
int strict);
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
-extern int ipv6_chk_home_addr(struct in6_addr *addr);
+extern int ipv6_chk_home_addr(struct net *net,
+ struct in6_addr *addr);
#endif
extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
struct in6_addr *addr,
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c4df6cd..803caf1 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2883,13 +2883,15 @@ void if6_proc_exit(void)
#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
/* Check if address is a home address configured on any interface. */
-int ipv6_chk_home_addr(struct in6_addr *addr)
+int ipv6_chk_home_addr(struct net *net, struct in6_addr *addr)
{
int ret = 0;
struct inet6_ifaddr * ifp;
u8 hash = ipv6_addr_hash(addr);
read_lock_bh(&addrconf_hash_lock);
for (ifp = inet6_addr_lst[hash]; ifp; ifp = ifp->lst_next) {
+ if (ifp->idev->dev->nd_net != net)
+ continue;
if (ipv6_addr_cmp(&ifp->addr, addr) == 0 &&
(ifp->flags & IFA_F_HOMEADDRESS)) {
ret = 1;
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 2df34ed..3cd1c99 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -445,7 +445,7 @@ looped_back:
kfree_skb(skb);
return -1;
}
- if (!ipv6_chk_home_addr(addr)) {
+ if (!ipv6_chk_home_addr(&init_net, addr)) {
IP6_INC_STATS_BH(ip6_dst_idev(skb->dst),
IPSTATS_MIB_INADDRERRORS);
kfree_skb(skb);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html