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:			bd4a39cc93
Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D49275
This commit is contained in:
Gleb Smirnoff
2025-03-06 22:57:11 -08:00
parent daa098cc37
commit e92a78ad7a
+1 -1
View File
@@ -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