For non-listening AF_UNIX sockets return error code EOPNOTSUPP to match

documentation and SUS.
This commit is contained in:
Gleb Smirnoff 2017-01-25 22:26:45 +00:00
parent ab5cda71df
commit beb4b31200

View File

@ -743,6 +743,9 @@ uipc_listen(struct socket *so, int backlog, struct thread *td)
struct unpcb *unp;
int error;
if (so->so_type != SOCK_STREAM && so->so_type != SOCK_SEQPACKET)
return (EOPNOTSUPP);
unp = sotounpcb(so);
KASSERT(unp != NULL, ("uipc_listen: unp == NULL"));