]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/tipc/socket.c
[SCSI] add missing transport configure points for target and host
[linux-2.6-omap-h63xx.git] / net / tipc / socket.c
index 84110172031ef6bfa69716a90ca4bbda6b48e3f4..24ddfd2ca38bf037e6b1710e78dedcd24aa0e1df 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;
@@ -250,7 +253,7 @@ static int release(struct socket *sock)
        dbg("sock_delete: %x\n",tsock);
        if (!tsock)
                return 0;
-       down_interruptible(&tsock->sem);
+       down(&tsock->sem);
        if (!sock->sk) {
                up(&tsock->sem);
                return 0;
@@ -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;