fix(libkernel): accept guest socket addresses whatever their sa_len #1088
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1088"
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 kjhq on 2026-10-07T10:34:26Z.
What
bind,connect,sendtoand the other socket calls rejected an address whosesa_lenbyte (byte 0) was not exactly 16 for IPv4 or 28 for IPv6. The FreeBSD kernel does not readsa_lenon input:getsockaddroverwrites it with the length argument. A title that leavessa_len0 gotEAFNOSUPPORT(47), which the console does not return for it.Now the family byte and the length argument alone decide the address kind; addresses returned to the guest still carry the correct
sa_len.guest_udp: binding127.0.0.1withsa_len0 succeeds andgetsocknamereportssa_len16.Title
PPSA17221 (Minecraft) needs #716 to load the modules in its app root, so every run below is current
main+ #716 + the PRs of this set (#1088, #1090–#1096), plus local changes outside it: dialog, NpAuth and TextToSpeech2 stubs that open PRs cover (#560, #925, #301) and a GPU end-of-pipe change that is not submitted. With all of them the title loads a world. The line below is from a run with only this PR left out, Windows 11, WinLibs GCC, normal user session.Without it the title crashes about 12 s after start:
With it, the title reaches a loaded world.
Tested
Debian 13 (WSL2), GCC 14.2.0, Release:
guest_udpandguest_tcppass. The new check fails onmainwithout the fix.Windows 11, WinLibs GCC: PPSA17221 with this PR and the rest of the set loads a world (runs described above). Not tested with Windows
ctest.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by TheAggie on 2026-10-08T00:30:47Z.
Another title this fixes: the DOOM homebrew PPSA99666 v1.1.1 (lowbit/ps5-doom) zeroes its
sockaddr_inand sets only the family and port, so its upload server'sbindfailed on every port:With the same change (I had made it independently before finding this PR), the server binds and, together with
pollandMSG_NOSIGNALsupport, served its page and received a 28.8 MB WAD intact. Windows 11, MinGW GCC 15.2.0 (WinLibs r7), RTX 5070 Ti.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T06:07:14Z.
Checked: build + full ctest on current main + this PR (416/416),
guest_udpfails with theUdp.cppchange reverted, Linux and Windows CI green. Matches FreeBSDgetsockaddr, which ignores the inputsa_len; returned addresses still carry the right one. Merging.