diff options
Diffstat (limited to 'net/atm')
-rw-r--r-- | net/atm/common.c | 4 | ||||
-rw-r--r-- | net/atm/common.h | 2 | ||||
-rw-r--r-- | net/atm/pvc.c | 7 | ||||
-rw-r--r-- | net/atm/svc.c | 11 |
4 files changed, 15 insertions, 9 deletions
diff --git a/net/atm/common.c b/net/atm/common.c index 299ec1eb872a..e166d9e0ffd9 100644 --- a/net/atm/common.c +++ b/net/atm/common.c | |||
@@ -125,7 +125,7 @@ static struct proto vcc_proto = { | |||
125 | .obj_size = sizeof(struct atm_vcc), | 125 | .obj_size = sizeof(struct atm_vcc), |
126 | }; | 126 | }; |
127 | 127 | ||
128 | int vcc_create(struct socket *sock, int protocol, int family) | 128 | int vcc_create(struct net *net, struct socket *sock, int protocol, int family) |
129 | { | 129 | { |
130 | struct sock *sk; | 130 | struct sock *sk; |
131 | struct atm_vcc *vcc; | 131 | struct atm_vcc *vcc; |
@@ -133,7 +133,7 @@ int vcc_create(struct socket *sock, int protocol, int family) | |||
133 | sock->sk = NULL; | 133 | sock->sk = NULL; |
134 | if (sock->type == SOCK_STREAM) | 134 | if (sock->type == SOCK_STREAM) |
135 | return -EINVAL; | 135 | return -EINVAL; |
136 | sk = sk_alloc(family, GFP_KERNEL, &vcc_proto, 1); | 136 | sk = sk_alloc(net, family, GFP_KERNEL, &vcc_proto, 1); |
137 | if (!sk) | 137 | if (!sk) |
138 | return -ENOMEM; | 138 | return -ENOMEM; |
139 | sock_init_data(sock, sk); | 139 | sock_init_data(sock, sk); |
diff --git a/net/atm/common.h b/net/atm/common.h index ad78c9e1117d..16f32c1fa1c9 100644 --- a/net/atm/common.h +++ b/net/atm/common.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/poll.h> /* for poll_table */ | 10 | #include <linux/poll.h> /* for poll_table */ |
11 | 11 | ||
12 | 12 | ||
13 | int vcc_create(struct socket *sock, int protocol, int family); | 13 | int vcc_create(struct net *net, struct socket *sock, int protocol, int family); |
14 | int vcc_release(struct socket *sock); | 14 | int vcc_release(struct socket *sock); |
15 | int vcc_connect(struct socket *sock, int itf, short vpi, int vci); | 15 | int vcc_connect(struct socket *sock, int itf, short vpi, int vci); |
16 | int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | 16 | int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, |
diff --git a/net/atm/pvc.c b/net/atm/pvc.c index 848e6e191cc7..43e8bf5ed001 100644 --- a/net/atm/pvc.c +++ b/net/atm/pvc.c | |||
@@ -124,10 +124,13 @@ static const struct proto_ops pvc_proto_ops = { | |||
124 | }; | 124 | }; |
125 | 125 | ||
126 | 126 | ||
127 | static int pvc_create(struct socket *sock,int protocol) | 127 | static int pvc_create(struct net *net, struct socket *sock,int protocol) |
128 | { | 128 | { |
129 | if (net != &init_net) | ||
130 | return -EAFNOSUPPORT; | ||
131 | |||
129 | sock->ops = &pvc_proto_ops; | 132 | sock->ops = &pvc_proto_ops; |
130 | return vcc_create(sock, protocol, PF_ATMPVC); | 133 | return vcc_create(net, sock, protocol, PF_ATMPVC); |
131 | } | 134 | } |
132 | 135 | ||
133 | 136 | ||
diff --git a/net/atm/svc.c b/net/atm/svc.c index 53d04c7992cf..daf9a48a7db0 100644 --- a/net/atm/svc.c +++ b/net/atm/svc.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "signaling.h" | 25 | #include "signaling.h" |
26 | #include "addr.h" | 26 | #include "addr.h" |
27 | 27 | ||
28 | static int svc_create(struct socket *sock,int protocol); | 28 | static int svc_create(struct net *net, struct socket *sock,int protocol); |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * Note: since all this is still nicely synchronized with the signaling demon, | 31 | * Note: since all this is still nicely synchronized with the signaling demon, |
@@ -326,7 +326,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags) | |||
326 | 326 | ||
327 | lock_sock(sk); | 327 | lock_sock(sk); |
328 | 328 | ||
329 | error = svc_create(newsock,0); | 329 | error = svc_create(sk->sk_net, newsock,0); |
330 | if (error) | 330 | if (error) |
331 | goto out; | 331 | goto out; |
332 | 332 | ||
@@ -627,12 +627,15 @@ static const struct proto_ops svc_proto_ops = { | |||
627 | }; | 627 | }; |
628 | 628 | ||
629 | 629 | ||
630 | static int svc_create(struct socket *sock,int protocol) | 630 | static int svc_create(struct net *net, struct socket *sock,int protocol) |
631 | { | 631 | { |
632 | int error; | 632 | int error; |
633 | 633 | ||
634 | if (net != &init_net) | ||
635 | return -EAFNOSUPPORT; | ||
636 | |||
634 | sock->ops = &svc_proto_ops; | 637 | sock->ops = &svc_proto_ops; |
635 | error = vcc_create(sock, protocol, AF_ATMSVC); | 638 | error = vcc_create(net, sock, protocol, AF_ATMSVC); |
636 | if (error) return error; | 639 | if (error) return error; |
637 | ATM_SD(sock)->local.sas_family = AF_ATMSVC; | 640 | ATM_SD(sock)->local.sas_family = AF_ATMSVC; |
638 | ATM_SD(sock)->remote.sas_family = AF_ATMSVC; | 641 | ATM_SD(sock)->remote.sas_family = AF_ATMSVC; |