net: pass kern to net_proto_family create function
[firefly-linux-kernel-4.4.55.git] / net / unix / af_unix.c
index 0f133c5a8d3c2a89ea1e045112e82d9f9b7d8d54..178d3af2a6054819f40f9d1212912c2df6dd5d0f 100644 (file)
@@ -621,7 +621,8 @@ out:
        return sk;
 }
 
-static int unix_create(struct net *net, struct socket *sock, int protocol)
+static int unix_create(struct net *net, struct socket *sock, int protocol,
+                      int kern)
 {
        if (protocol && protocol != PF_UNIX)
                return -EPROTONOSUPPORT;
@@ -1074,6 +1075,8 @@ restart:
        err = -ECONNREFUSED;
        if (other->sk_state != TCP_LISTEN)
                goto out_unlock;
+       if (other->sk_shutdown & RCV_SHUTDOWN)
+               goto out_unlock;
 
        if (unix_recvq_full(other)) {
                err = -EAGAIN;