From beb4b312004b7b700f856eff174a6edc42895db1 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 25 Jan 2017 22:26:45 +0000 Subject: For non-listening AF_UNIX sockets return error code EOPNOTSUPP to match documentation and SUS. --- sys/kern/uipc_usrreq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 10f3ac2b88f3..ada9080c623d 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -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")); -- cgit v1.2.3