Date: Mon, 6 Jan 2025 22:56:59 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 1c933f464fdb - main - unix: Be consistent about error handling for unconnected sockets Message-ID: <202501062256.506Muxq7050114@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c933f464fdbb630f9663751f04c29cdcda38902 commit 1c933f464fdbb630f9663751f04c29cdcda38902 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2025-01-06 22:55:38 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2025-01-06 22:56:34 +0000 unix: Be consistent about error handling for unconnected sockets SOCK_STREAM and SOCK_SEQPACKET sockets should get the same treatment here. PR: 176420 MFC after: 2 weeks --- sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 7af73a1d344b..3d7e5bcc5ad0 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1796,7 +1796,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt) if (unp->unp_flags & UNP_HAVEPC) xu = unp->unp_peercred; else { - if (so->so_type == SOCK_STREAM) + if (so->so_proto->pr_flags & PR_CONNREQUIRED) error = ENOTCONN; else error = EINVAL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501062256.506Muxq7050114>