fix(libkernel): return the zero address for unbound getsockname on Windows #3947
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3947"
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 MarcZX10 on 2026-10-11T19:38:18Z.
What
Carries Hussein Kadhim's fix for #3943, preserving the original commit author. On Windows, an unbound IPv4 or IPv6 socket can make Winsock
getsocknamereturnWSAEINVAL; the guest call now returns the zero address for that socket family. The regression test covers TCP and UDP sockets for both families and checks the address length, family, zeroed bytes, and buffer boundary.Tested
BUILD_TESTING=ON: builtguest_tcp_tests;guest_tcppassed 1/1. Linux does not enter the Windows-specific fallback.guest_tcp,guest_udp,guest_poll,guest_socket, andguest_duptests.tools/check_conventions.py --base upstream/mainandgit diff --checkpassed.Checklist
main; no other open PR implements this behaviorImported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T20:43:52Z.
Windows run of this head (
41e933562, onmaina11c8f7f7): Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, full build.guest_tcp,guest_udp,guest_socket_read_write,guest_poll,guest_socket_pair,guest_dupandguest_socket_events: 7/7 pass in 3 runs.Udp.cppreverted tomain,guest_tcpaborts (0xc0000409) in the newUnboundSocketNameIsZerotest, so on Windows the test catches the bug and the fix is what makes it pass.main()inGuestTcp.cpp, so any two of them conflict there (Udp.cppmerges cleanly). The second and third to land will need a small rebase.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T08:24:37Z.
Conflicts with main in
core/libs/tests/GuestTcp.cppsince #3957 went in; please rebase.