A tiny bug; error code is incorrect for the SEQPACKET retrieval of LOCAL_PEERCRED. * An unconnected SOCK_STREAM: get ENOTCONN * A SOCK_DGRAM: get EINVAL * An unconnected SOCK_SEQPACKET: get EINVAL, but should get ENOTCONN Fix: Patch attached for RELEASE-9.1 Patch attached with submission follows:
Responsible Changed From-To: freebsd-bugs->freebsd-net Over to maintainer(s).
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
A commit in branch main references this bug: 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(-)
Wow, my twelve year old patch applied cleanly! Nice, thank you Mark. I expect there's roughly zero people in the world in that time who have used SEQPACKET (unusual), over a local socket, with PEERCRED (unusual), on FreeBSD (fairly obscure community). So, thank you!
(In reply to Nicholas Wilson from comment #5) Certainly, sorry it took so long to get this addressed. As you might surmise, some of us have been trying to comb through the bugzilla backlog. I agree that the bug is rather obscure, but this patch seemed obviously right, especially when looking at the handling of socket types in uipc_usrreq.c more generally. So, thanks for the report.
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8373644ee2c848bab47d87d24b31d673e6515bce commit 8373644ee2c848bab47d87d24b31d673e6515bce Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2025-01-06 22:55:38 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2025-01-20 00:26:27 +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 (cherry picked from commit 1c933f464fdbb630f9663751f04c29cdcda38902) sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)