diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-08-06 04:46:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-15 02:29:59 -0400 |
commit | bb2db45b5495455ec7580315029184550709f4a2 (patch) | |
tree | ec79a1e987bcb1a93b389012d0d0eb2830f34b5c /net/sctp/ipv6.c | |
parent | 13d782f6b4fbbaf9d0380a9947deb45a9de46ae7 (diff) |
sctp: Enable sctp in all network namespaces
- Fix the sctp_af operations to work in all namespaces
- Enable sctp socket creation in all network namespaces.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/ipv6.c')
-rw-r--r-- | net/sctp/ipv6.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index bbf15341eb2b..a18cda60e156 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -582,7 +582,7 @@ static int sctp_v6_available(union sctp_addr *addr, struct sctp_sock *sp) | |||
582 | if (!(type & IPV6_ADDR_UNICAST)) | 582 | if (!(type & IPV6_ADDR_UNICAST)) |
583 | return 0; | 583 | return 0; |
584 | 584 | ||
585 | return ipv6_chk_addr(&init_net, in6, NULL, 0); | 585 | return ipv6_chk_addr(sock_net(&sp->inet.sk), in6, NULL, 0); |
586 | } | 586 | } |
587 | 587 | ||
588 | /* This function checks if the address is a valid address to be used for | 588 | /* This function checks if the address is a valid address to be used for |
@@ -859,14 +859,14 @@ static int sctp_inet6_bind_verify(struct sctp_sock *opt, union sctp_addr *addr) | |||
859 | struct net_device *dev; | 859 | struct net_device *dev; |
860 | 860 | ||
861 | if (type & IPV6_ADDR_LINKLOCAL) { | 861 | if (type & IPV6_ADDR_LINKLOCAL) { |
862 | struct net *net; | ||
862 | if (!addr->v6.sin6_scope_id) | 863 | if (!addr->v6.sin6_scope_id) |
863 | return 0; | 864 | return 0; |
865 | net = sock_net(&opt->inet.sk); | ||
864 | rcu_read_lock(); | 866 | rcu_read_lock(); |
865 | dev = dev_get_by_index_rcu(&init_net, | 867 | dev = dev_get_by_index_rcu(net, addr->v6.sin6_scope_id); |
866 | addr->v6.sin6_scope_id); | ||
867 | if (!dev || | 868 | if (!dev || |
868 | !ipv6_chk_addr(&init_net, &addr->v6.sin6_addr, | 869 | !ipv6_chk_addr(net, &addr->v6.sin6_addr, dev, 0)) { |
869 | dev, 0)) { | ||
870 | rcu_read_unlock(); | 870 | rcu_read_unlock(); |
871 | return 0; | 871 | return 0; |
872 | } | 872 | } |
@@ -899,7 +899,7 @@ static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr) | |||
899 | if (!addr->v6.sin6_scope_id) | 899 | if (!addr->v6.sin6_scope_id) |
900 | return 0; | 900 | return 0; |
901 | rcu_read_lock(); | 901 | rcu_read_lock(); |
902 | dev = dev_get_by_index_rcu(&init_net, | 902 | dev = dev_get_by_index_rcu(sock_net(&opt->inet.sk), |
903 | addr->v6.sin6_scope_id); | 903 | addr->v6.sin6_scope_id); |
904 | rcu_read_unlock(); | 904 | rcu_read_unlock(); |
905 | if (!dev) | 905 | if (!dev) |