summaryrefslogtreecommitdiffstats
path: root/net/ipv6/af_inet6.c
diff options
context:
space:
mode:
authorDaniel Lezcano2008-01-11 07:43:18 +0100
committerDavid S. Miller2008-01-29 00:01:44 +0100
commitbfeade087005278fc8cafe230b7658a4f40c5acb (patch)
treed9bbacab07552cc6c33f9f022a34af2391d9ecc1 /net/ipv6/af_inet6.c
parent[NETNS][IPV6]: inet6_addr - isolate inet6 addresses from proc file (diff)
downloadkernel-qcow2-linux-bfeade087005278fc8cafe230b7658a4f40c5acb.tar.gz
kernel-qcow2-linux-bfeade087005278fc8cafe230b7658a4f40c5acb.tar.xz
kernel-qcow2-linux-bfeade087005278fc8cafe230b7658a4f40c5acb.zip
[NETNS][IPV6]: inet6_addr - check ipv6 address per namespace
When a new address is added, we must check if the new address does not already exists. This patch makes this check to be aware of a network namespace, so the check will look if the address already exists for the specified network namespace. While the addresses are browsed, the addresses which do not belong to the namespace are discarded. 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/af_inet6.c')
-rw-r--r--net/ipv6/af_inet6.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index ac8772dd968f..3150c4be3c0c 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -314,7 +314,8 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
*/
v4addr = LOOPBACK4_IPV6;
if (!(addr_type & IPV6_ADDR_MULTICAST)) {
- if (!ipv6_chk_addr(&addr->sin6_addr, dev, 0)) {
+ if (!ipv6_chk_addr(&init_net, &addr->sin6_addr,
+ dev, 0)) {
if (dev)
dev_put(dev);
err = -EADDRNOTAVAIL;