aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2017-01-25 22:26:45 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2017-01-25 22:26:45 +0000
commitbeb4b312004b7b700f856eff174a6edc42895db1 (patch)
tree2360edc7742aa28602a6cf4957d34f2cad19993f
parentab5cda71df1d9b12d243f30d6f8183f65ae8355c (diff)
downloadsrc-beb4b312004b.tar.gz
src-beb4b312004b.zip
For non-listening AF_UNIX sockets return error code EOPNOTSUPP to match
documentation and SUS.
Notes
Notes: svn path=/head/; revision=312784
-rw-r--r--sys/kern/uipc_usrreq.c3
1 files changed, 3 insertions, 0 deletions
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"));