summaryrefslogtreecommitdiff
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorHerbert Pƶtzl <herbert@13thfloor.at>2005-03-09 04:43:08 -0800
committerDavid S. Miller <davem@northbeach.davemloft.net.davemloft.net>2005-03-09 04:43:08 -0800
commit1cc6b1043b153dbff4458f7ec6ef5f712ea353d2 (patch)
treed411ed982a0d18e41613f01d11a75baf45743e75 /net/unix/af_unix.c
parent6fab4b4501dd8ca0165f6594b0df9ca4618eac10 (diff)
[NET]: Passcred cleanup in struct sock
struct socket uses a 'bool' (unsigned char) to 'flag' the pass-credential option for sockets (which can be easily replaced by a flag) Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 5658798cabc1..0768f8814759 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -861,8 +861,8 @@ static int unix_dgram_connect(struct socket *sock, struct sockaddr *addr,
goto out;
alen = err;
- if (sock->passcred && !unix_sk(sk)->addr &&
- (err = unix_autobind(sock)) != 0)
+ if (test_bit(SOCK_PASSCRED, &sock->flags) &&
+ !unix_sk(sk)->addr && (err = unix_autobind(sock)) != 0)
goto out;
other=unix_find_other(sunaddr, alen, sock->type, hash, &err);
@@ -952,7 +952,8 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr *uaddr,
goto out;
addr_len = err;
- if (sock->passcred && !u->addr && (err = unix_autobind(sock)) != 0)
+ if (test_bit(SOCK_PASSCRED, &sock->flags)
+ && !u->addr && (err = unix_autobind(sock)) != 0)
goto out;
timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
@@ -1286,7 +1287,8 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
goto out;
}
- if (sock->passcred && !u->addr && (err = unix_autobind(sock)) != 0)
+ if (test_bit(SOCK_PASSCRED, &sock->flags)
+ && !u->addr && (err = unix_autobind(sock)) != 0)
goto out;
err = -EMSGSIZE;