projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[NET]: Make the device list and device lookups per namespace.
[GitHub/MotorolaMobilityLLC/kernel-slsi.git]
/
net
/
ipv6
/
af_inet6.c
diff --git
a/net/ipv6/af_inet6.c
b/net/ipv6/af_inet6.c
index b5f96372ad7344b3b815b85a5e29a0b08ac8ad13..e5c5aad44bb15dee473cdaa5bbfd133f827ed43b 100644
(file)
--- a/
net/ipv6/af_inet6.c
+++ b/
net/ipv6/af_inet6.c
@@
-81,7
+81,7
@@
static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
return (struct ipv6_pinfo *)(((u8 *)sk) + offset);
}
return (struct ipv6_pinfo *)(((u8 *)sk) + offset);
}
-static int inet6_create(struct socket *sock, int protocol)
+static int inet6_create(struct
net *net, struct
socket *sock, int protocol)
{
struct inet_sock *inet;
struct ipv6_pinfo *np;
{
struct inet_sock *inet;
struct ipv6_pinfo *np;
@@
-94,6
+94,9
@@
static int inet6_create(struct socket *sock, int protocol)
int try_loading_module = 0;
int err;
int try_loading_module = 0;
int err;
+ if (net != &init_net)
+ return -EAFNOSUPPORT;
+
if (sock->type != SOCK_RAW &&
sock->type != SOCK_DGRAM &&
!inet_ehash_secret)
if (sock->type != SOCK_RAW &&
sock->type != SOCK_DGRAM &&
!inet_ehash_secret)
@@
-159,7
+162,7
@@
lookup_protocol:
BUG_TRAP(answer_prot->slab != NULL);
err = -ENOBUFS;
BUG_TRAP(answer_prot->slab != NULL);
err = -ENOBUFS;
- sk = sk_alloc(PF_INET6, GFP_KERNEL, answer_prot, 1);
+ sk = sk_alloc(
net,
PF_INET6, GFP_KERNEL, answer_prot, 1);
if (sk == NULL)
goto out;
if (sk == NULL)
goto out;
@@
-299,7
+302,7
@@
int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
err = -EINVAL;
goto out;
}
err = -EINVAL;
goto out;
}
- dev = dev_get_by_index(sk->sk_bound_dev_if);
+ dev = dev_get_by_index(
&init_net,
sk->sk_bound_dev_if);
if (!dev) {
err = -ENODEV;
goto out;
if (!dev) {
err = -ENODEV;
goto out;