fix(libSceNet): name an unbound socket with the zero address on Windows #4614
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4614"
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 EagleBearerYS on 2026-10-12T16:45:38Z.
What
sceNetGetsocknameon a socket that is neither bound nor connected failed with EINVAL (0x80410116, errno 22) on Windows, where Winsock reportsWSAEINVAL. FreeBSD 11.4 returns the wildcard address with port 0 (in_getsockaddr, in6_getsockaddr), and Linux already does, so onWSAEINVALthe call now builds that address for the socket's family. This is the libSceNet side of #3943, which describes the same failure for libkernel'sgetsockname.Tested
Windows 11 (10.0.26300), WinLibs MinGW-w64 GCC 15.2.0 r7 (UCRT), Release,
-DBUILD_TESTING=ON, onmainat2a5eca11:main'sExport.cpp, the newCheckUnboundSocketNameinguest_sce_netaborts (exit0xc0000409);guest_sce_netpasses onmainitself, IPv6 checks included, so the abort is the new check. With the change it passes, 20 runs in a row. Both the IPv4 and the IPv6 sockets are checked, for TCP and UDP.core/libs/prx/libc/CMakeLists.txtandcore/libs/prx/libkernel/CMakeLists.txtthat build on Windows pass, and so do the network tests (guest_datagram_recv,guest_datagram_recvfrom,guest_datagram_sceNetRecv,guest_datagram_sceNetRecvfrom,guest_udp,guest_resolver,guest_posix_filesystem).Linux (Ubuntu 24.04, GCC 13.3, Release), base
33ae282e: the newCheckUnboundSocketNameinguest_sce_netpasses before and after, since Linux already returns the zero address. Again on WSL2 (Ubuntu 24.04, GCC 13.3.0, Release with CI's configure flags), merged intomainatc952c2b0e, IPv6 checks included: it passes withmain'sExport.cppand with the change, 20 runs in a row.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T14:57:48Z.
Checked the
WSAEINVALfallback insceNetGetsockname(zero address of the socket's family, other errors unchanged) andCheckUnboundSocketName(IPv4/IPv6, TCP/UDP, length/family/zero bytes);guest_sce_netpasses on the merged tree. The Windows behaviour is covered by the full Build's windows job; merging once it is green.