]> Pileus Git - ~andy/linux/blobdiff - net/tipc/socket.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[~andy/linux] / net / tipc / socket.c
index 84110172031ef6bfa69716a90ca4bbda6b48e3f4..6b792265dc06e5b08085095178bd4fba3e427ff7 100644 (file)
@@ -162,13 +162,16 @@ static void advance_queue(struct tipc_sock *tsock)
  *
  * Returns 0 on success, errno otherwise
  */
-static int tipc_create(struct socket *sock, int protocol)
+static int tipc_create(struct net *net, struct socket *sock, int protocol)
 {
        struct tipc_sock *tsock;
        struct tipc_port *port;
        struct sock *sk;
        u32 ref;
 
+       if (net != &init_net)
+               return -EAFNOSUPPORT;
+
        if (unlikely(protocol != 0))
                return -EPROTONOSUPPORT;
 
@@ -198,7 +201,7 @@ static int tipc_create(struct socket *sock, int protocol)
                return -EPROTOTYPE;
        }
 
-       sk = sk_alloc(AF_TIPC, GFP_KERNEL, &tipc_proto, 1);
+       sk = sk_alloc(net, AF_TIPC, GFP_KERNEL, &tipc_proto);
        if (!sk) {
                tipc_deleteport(ref);
                return -ENOMEM;
@@ -1372,7 +1375,7 @@ static int accept(struct socket *sock, struct socket *newsock, int flags)
        }
        buf = skb_peek(&sock->sk->sk_receive_queue);
 
-       res = tipc_create(newsock, 0);
+       res = tipc_create(sock->sk->sk_net, newsock, 0);
        if (!res) {
                struct tipc_sock *new_tsock = tipc_sk(newsock->sk);
                struct tipc_portid id;