diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 7553ea6edd8f..f25511903115 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1033,8 +1033,8 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr, | |||
1033 | goto out; | 1033 | goto out; |
1034 | addr_len = err; | 1034 | addr_len = err; |
1035 | 1035 | ||
1036 | if (test_bit(SOCK_PASSCRED, &sock->flags) | 1036 | if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr && |
1037 | && !u->addr && (err = unix_autobind(sock)) != 0) | 1037 | (err = unix_autobind(sock)) != 0) |
1038 | goto out; | 1038 | goto out; |
1039 | 1039 | ||
1040 | timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); | 1040 | timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); |
@@ -1378,8 +1378,8 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
1378 | goto out; | 1378 | goto out; |
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | if (test_bit(SOCK_PASSCRED, &sock->flags) | 1381 | if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr |
1382 | && !u->addr && (err = unix_autobind(sock)) != 0) | 1382 | && (err = unix_autobind(sock)) != 0) |
1383 | goto out; | 1383 | goto out; |
1384 | 1384 | ||
1385 | err = -EMSGSIZE; | 1385 | err = -EMSGSIZE; |