Repository navigation
fix(libSceNet): return EOPNOTSUPP when connecting a listening socket - #7490
Conversation
sceNetConnect on a listening stream socket passed the call to the host, so it failed with EISCONN (0x80410138) on Linux, EINVAL on Windows, and EAFNOSUPPORT (0x8041012f) for an address of the other family. FreeBSD 11.4 soconnectat refuses any connect on a socket with SO_ACCEPTCONN with EOPNOTSUPP before the protocol looks at the address, and libkernel connect does the same since boykopovar#6950. Return 0x8041012d (EOPNOTSUPP) for a listening socket once the address is converted, before the family check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Windows run, since this was only syntax-checked there: Windows 11 (MinGW GCC 15.2), with this PR merged onto
This matches AI-assisted: yes (Claude Code); results above were run on this machine. |
|
Ran this on macOS, since it was not run there: Apple M1, macOS 26.6.2 (25G83), x86-64 build under Rosetta 2, AppleClang 21. Merged into the macOS host branch of #7332 (
AI-assisted: yes (Claude Code). I ran the build and tests on my machine. |
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
|
Windows check of head Setup: Windows 11 x64, WinLibs GCC 15.2.0 (r7), Ninja, Release,
AI-assisted: yes. |
What
sceNetConnecton a listening stream socket handed the call to the host. On Linux it failed with0x80410138(EISCONN); on Windows, Winsock documentsWSAEINVALfor it, which maps to0x80410116(EINVAL). With an address of the other family it failed with0x8041012f(EAFNOSUPPORT) before reaching the host.FreeBSD 11.4 refuses any connect on a listening socket first.
sys_connectcopies the address in and callskern_connectat, which callssoconnect;soconnectatreturnsEOPNOTSUPPwhenSO_ACCEPTCONNis set, before the protocol'spru_connectlooks at the address family. libkernelconnectdoes the same since #6950.sceNetConnectnow returns0x8041012d(EOPNOTSUPP, errno 45) for a socket thatsceNetListenhas put into the listening state, once the address is converted and before the family check, as #6950 does forconnect. Null and short addresses keep their address errors. The listener keeps accepting afterwards. I don't know of a title that hits this.Tested
Gentoo Linux, kernel 7.2.8, GCC 16.2.1, glibc 2.43, Release,
BUILD_TESTING=ON, onmaincb1d6e5.guest_sce_netwith the new lines:sceNetConnecton the listener, to its own address and to a 28-byteAF_INET6address, returns0x8041012dwithsceNetErrnoLoc()45, and the client connect andsceNetAcceptthat follow still succeed. With onlyExport.cppreverted tomainthe test aborts; a probe against that build prints0x80410138(errno 56) and0x8041012f(errno 47) for the two calls.ctest -j6 --timeout 300: 1435 tests, 0 failed, 13 skipped (12 VideoOut tests andagc_driver_stencil_ref_export, which skip onmainon this machine too).Export.cppandGuestSceNet.cppcompile withx86_64-w64-mingw32-g++16.2 (-fsyntax-only -Wall -Wextra). This is a syntax check, not a Windows build or run.tools/check_conventions.pypasses againstmain.tools/pr_overlap.py --branchreports no overlapping lines; it lists fix(libSceNet): stop Sackboy loading retries on peer sockets #5836, fix: complete compatibility gaps #6447, Macos port #7201 and feat: macOS on Apple Silicon host support (Rosetta 2 and MoltenVK) #7332 (Export.cpp) and fix(libSceNet): stop Sackboy loading retries on peer sockets #5836, test: organize library tests and label CTest suites #6044 and fix(libSceNetCtl): keep the callback argument and deliver the state from sceNetCtlCheckCallback #6138 (GuestSceNet.cpp) under shared files not compared, since they conflict withmain. None of their diffs changessceNetConnect.Not run on Windows, macOS or a console.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code