Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2017 22:26:45 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312784 - head/sys/kern
Message-ID:  <201701252226.v0PMQjJr043197@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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"));
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701252226.v0PMQjJr043197>