svn commit: r312784 - head/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Wed Jan 25 22:26:46 UTC 2017


Author: glebius
Date: Wed Jan 25 22:26:45 2017
New Revision: 312784
URL: https://svnweb.freebsd.org/changeset/base/312784

Log:
  For non-listening AF_UNIX sockets return error code EOPNOTSUPP to match
  documentation and SUS.

Modified:
  head/sys/kern/uipc_usrreq.c

Modified: head/sys/kern/uipc_usrreq.c
==============================================================================
--- head/sys/kern/uipc_usrreq.c	Wed Jan 25 21:35:15 2017	(r312783)
+++ head/sys/kern/uipc_usrreq.c	Wed Jan 25 22:26:45 2017	(r312784)
@@ -743,6 +743,9 @@ uipc_listen(struct socket *so, int backl
 	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"));
 


More information about the svn-src-head mailing list