fix(libSceNet): return EOPNOTSUPP when connecting a listening socket #7490
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7490"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Lindamea1 on 2026-10-18T09:21:36Z.
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, onmaincb1d6e5bd.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 #5836, #6447, #7201 and #7332 (Export.cpp) and #5836, #6044 and #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
Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-18T12:20:09Z.
Windows run, since this was only syntax-checked there: Windows 11 (MinGW GCC 15.2), with this PR merged onto
main9f25d0bf5.guest_sce_netwith the two newsceNetConnectchecks passes, and the listener still accepts afterwards.GuestSceNet.cppfrom this PR, the test aborts onmainon Windows, as on Ubuntu 24.04 (GCC 13.3).This matches
soconnectat(uipc_socket.c:993-994).AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by ycarogabriel-lgtm on 2026-10-19T00:13:30Z.
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 (
57bccfbfc,mainatd71853cf2) together with #7121, #7475, #7490, #7507 and #7612;Releasebuild.guest_sce_netpasses, including the newEOPNOTSUPPcheck for connecting a listening socket.guest_kqueuecase from #7121 that is unrelated to this change.AI-assisted: yes (Claude Code). I ran the build and tests on my machine.