Repository navigation
fix(libSceNet): name an unbound socket with the zero address on Windows - #4614
Merged
adriadam10 merged 2 commits intoOct 13, 2026
Merged
adriadam10 merged 2 commits into
adriadam10 merged 2 commits into
Conversation
sceNetGetsockname on a socket that is neither bound nor connected failed with EINVAL on Windows, where Winsock reports WSAEINVAL. FreeBSD 11.4 returns the wildcard address with port 0 (in_getsockaddr and in6_getsockaddr in sys/netinet/in_pcb.c and sys/netinet6/in6_pcb.c), and Linux already does, so the call now builds that address for the socket's family.
6 tasks done
boykopovar#4785 calls its netstat check right after CheckPoolStats(), so calling CheckUnboundSocketName() there made the two pull requests conflict.
Collaborator
|
Checked the |
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, onmainat 2a5eca1: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 33ae282: the new
CheckUnboundSocketNameinguest_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 intomainat c952c2b, 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)