aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/af_irda.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/af_irda.c')
-rw-r--r--net/irda/af_irda.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index c80949a71923..0328ae2654f4 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -60,7 +60,7 @@
60 60
61#include <net/irda/af_irda.h> 61#include <net/irda/af_irda.h>
62 62
63static int irda_create(struct socket *sock, int protocol); 63static int irda_create(struct net *net, struct socket *sock, int protocol);
64 64
65static const struct proto_ops irda_stream_ops; 65static const struct proto_ops irda_stream_ops;
66static const struct proto_ops irda_seqpacket_ops; 66static const struct proto_ops irda_seqpacket_ops;
@@ -831,7 +831,7 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags)
831 831
832 IRDA_DEBUG(2, "%s()\n", __FUNCTION__); 832 IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
833 833
834 err = irda_create(newsock, sk->sk_protocol); 834 err = irda_create(sk->sk_net, newsock, sk->sk_protocol);
835 if (err) 835 if (err)
836 return err; 836 return err;
837 837
@@ -1057,13 +1057,16 @@ static struct proto irda_proto = {
1057 * Create IrDA socket 1057 * Create IrDA socket
1058 * 1058 *
1059 */ 1059 */
1060static int irda_create(struct socket *sock, int protocol) 1060static int irda_create(struct net *net, struct socket *sock, int protocol)
1061{ 1061{
1062 struct sock *sk; 1062 struct sock *sk;
1063 struct irda_sock *self; 1063 struct irda_sock *self;
1064 1064
1065 IRDA_DEBUG(2, "%s()\n", __FUNCTION__); 1065 IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
1066 1066
1067 if (net != &init_net)
1068 return -EAFNOSUPPORT;
1069
1067 /* Check for valid socket type */ 1070 /* Check for valid socket type */
1068 switch (sock->type) { 1071 switch (sock->type) {
1069 case SOCK_STREAM: /* For TTP connections with SAR disabled */ 1072 case SOCK_STREAM: /* For TTP connections with SAR disabled */
@@ -1075,7 +1078,7 @@ static int irda_create(struct socket *sock, int protocol)
1075 } 1078 }
1076 1079
1077 /* Allocate networking socket */ 1080 /* Allocate networking socket */
1078 sk = sk_alloc(PF_IRDA, GFP_ATOMIC, &irda_proto, 1); 1081 sk = sk_alloc(net, PF_IRDA, GFP_ATOMIC, &irda_proto, 1);
1079 if (sk == NULL) 1082 if (sk == NULL)
1080 return -ENOMEM; 1083 return -ENOMEM;
1081 1084