From nobody Mon Jan 06 22:56:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YRqLg4lNtz5kMHP; Mon, 06 Jan 2025 22:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YRqLg2vMXz4rWT; Mon, 6 Jan 2025 22:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xmbcfBSxnNn+tCcag9Pn0vzTdcuHudhYi7ekjgNZhk=; b=bL3Pq4HmoLKL/k03HPFQnU5bn564W1rpXglH0UWoe9P67q9f3Tl1zFNoKiFVsZ6iVZwQbl oWP8k3Hd2uaxl1b22VQxq4NxSDo4uATGE6EuIVFJj/24HgnGuiNbaiHwIgrYnKHCJlorCs NxL7N1MVmIzPKFgkxR70OC1w3KoJAU5nsy6PP9Y2LtKV0VbF7At27qAFYfY2W18CoYTif3 f1Fe8SvqtYXv5s/fXrk2avku9iWBX21h+K9QWz/TVVuF/WrH6feEXo71uSt9u7MvT1v0ii U5JFERUcVmEqfzNhTUO1mqeR3qMdktuy4SChF/U0ZdSRITpNmM+szRlxKot0qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736204219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xmbcfBSxnNn+tCcag9Pn0vzTdcuHudhYi7ekjgNZhk=; b=tqdGlY7qyhMZHZyU3NFaVNhwcKcJhjdvxd6rUBfd+yjo+e3o+aL9xjEGRK+N7dgKw72fT8 lW4gFZLwxc7pHfFMg1b/UJgMuYdHUE4WHXVBHYnFJjTsCeNY/Lje0QmxPOpYzwT++Clb95 w2nqDYYMhHOYLriNkLGZtixy2IS9uCHsgy8Ae8tuHwDgWxxhHqlPh40ZYkHUbOlO7brzeb +KY0NmW8hYZLRNgWblxUpXZmcU24A76k/Vlw7YErg22GFnGSKwiHaidLO9Zi/wMDS5aBff 5dF+9zT4SkULty/Om5n95kQ03flGMtGrCWCbMsznjh6va54ssyYcSFxLU6UNeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736204219; a=rsa-sha256; cv=none; b=GaTRIiAo6josUuBBgSg1MjYWHSsxdnrgFfkqK+nlw1TgoWuh9KfxOCWwKUgACTVQQpTir7 ejrqCwSgnI4thuP7xMi4OO2i1k3gsSvNgY9w5SXQAbKnxiCLb4ZdFOb79Njs5m1HMoh3q1 IcYWZrvHIc6CI1tYHmuNv1WgXCeaFttbqbKK+rAQrvfJoqEz+iTUJ/Cd+iyvB7kpQcdlSF bbhJ4FBP8+OzGl7c/3njHlcZgsYc622B52xxC0wyNBM6KaBeFNVadkIaI33DLt5mQUCI5g Iz2DiVG+d2QiY9AOZ2ML5oZLg5VHBG9HsTBTyv02eGtc3Eq/ONyL2K7x/PQ72g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YRqLg2W1yzkyw; Mon, 06 Jan 2025 22:56:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 506Muxle050117; Mon, 6 Jan 2025 22:56:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 506Muxq7050114; Mon, 6 Jan 2025 22:56:59 GMT (envelope-from git) Date: Mon, 6 Jan 2025 22:56:59 GMT Message-Id: <202501062256.506Muxq7050114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1c933f464fdb - main - unix: Be consistent about error handling for unconnected sockets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c933f464fdbb630f9663751f04c29cdcda38902 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c933f464fdbb630f9663751f04c29cdcda38902 commit 1c933f464fdbb630f9663751f04c29cdcda38902 Author: Mark Johnston AuthorDate: 2025-01-06 22:55:38 +0000 Commit: Mark Johnston 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;