net: pass kern to net_proto_family create function
[firefly-linux-kernel-4.4.55.git] / net / unix / af_unix.c
index 51ab497115eb7eda412870a895a8e2197adbffca..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;
@@ -2214,7 +2217,7 @@ static const struct file_operations unix_seq_fops = {
 
 #endif
 
-static struct net_proto_family unix_family_ops = {
+static const struct net_proto_family unix_family_ops = {
        .family = PF_UNIX,
        .create = unix_create,
        .owner  = THIS_MODULE,