The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=e92a78ad7a778feb60f634ceda245f8b761a76ff
commit e92a78ad7a778feb60f634ceda245f8b761a76ff Author: Gleb Smirnoff <gleb...@freebsd.org> AuthorDate: 2025-03-07 06:57:11 +0000 Commit: Gleb Smirnoff <gleb...@freebsd.org> CommitDate: 2025-03-07 06:57:11 +0000 tcp: return EOPNOTSUPP on attempt to connect(2) a listening socket This is the error code specified by SUS. Only the TCP over IPv6 required this fix. Fixes: bd4a39cc93d9faf8b5c000855d5aa90df592dd49 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49275 --- sys/netinet/tcp_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 0b4a93390f1b..03687c1d3515 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -594,7 +594,7 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) goto out; } if (SOLISTENING(so)) { - error = EINVAL; + error = EOPNOTSUPP; goto out; } #ifdef INET