fix(libSceNet): describe sockets made with socket() in sceNetGetSockInfo #9948
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9948"
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 ntamas94 on 2026-10-22T23:27:34Z.
What
On the console the kernel socket calls and libSceNet share one descriptor space:
sceNetGetSockInfodescribes a socket made withsocket()exactly like one made withsceNetSocket, and lists it whensis below 0. AnyPS5 answeredEBADFfor such a descriptor and left it out of the list, because libSceNet only looked in its own table. Knowledge is Power: Decades (CUSA12435) callssceNetGetSockInfoon its PlayLink server socket, which it makes withsocket(), right after binding it, and reads from it only whenrecv_queue_lengthis not 0 (#9932).libkernel now exports two helpers next to
KernelLookupSocketNative_nid_no_patch:KernelDescribeSocket_nid_no_patchreturns one of its sockets' native handle together with the owner that keeps it open, its family, type and non-blocking mode, andKernelListSockets_nid_no_patchlists its descriptors.sceNetGetSockInforeads its own table first and the kernel's otherwise, and merges both into the sorted list. The socket is not adopted into libSceNet's table, so closing it withclose()leaves nothing stale behind. Other sceNet calls on such a socket still answerEBADF; the debt entry says so.sock_buffer_sizenow takes the record's source (native handle and configured sizes) instead of aSock; #8362 calls it with aSockin its newfill_sock_info6, so whichever of the two lands second needs that call adapted.guest_sce_netgains rows for a UDP socket made withsocket_nid_postfixand bound to 127.0.0.1: its record (descriptor, type 2, address, port,SELFflag, buffer sizes), its place in the list, andEBADFafterclose_nid_postfix. With the oldExport.cpp,SocketPoll.hppandUdp.cppthe test aborts at the first new row.Tested
Windows 11, MinGW-w64 GCC (winlibs), Ninja:
guest_sce_netpassed on the final head (659962c,main895f47f),python tools/check_conventions.py --base origin/mainpasses. Measured on a PS4 Pro (firmware 10.71) with a homebrew probe: a bound UDP socket fromsocket()and one fromsceNetSocketboth return 1 with a full record, andsceNetGetSockInfo(-1, NULL, 0, 0)counts both:Not run with a title.
Refresh — 2026-11-03 (Codex, AI-assisted): Merged main
086c0686c8and adapted sceNetShowNetstat's two buffer-size calls to SockInfoSource while retaining the copied socket owner's lifetime and configured buffer sizes. Kept main's queue-length evidence and the separate kernel-socket listing entry. MinGW-w64 GCC 15.2 syntax-only compilation passes for Export.cpp, libkernel Socket/src/Udp.cpp and GuestSceNet.cpp; conventions and whitespace checks pass. Focused runtime tests have not been rerun on this merged head.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:43:32Z.
Review: COMMENTED
The new integration evidence answers my earlier Linux test request: the reported Windows 8/8 and WSL2 8/8 focused runs include this PR alongside #9932, #9930, #9931 and the other listed network changes, and retain the kernel-created socket record coverage. I also reran current-main whitespace and conventions checks; both pass.\n\nOne remaining integration gap: the branch is 5 commits ahead and 264 behind current
main(merge base895f47f4), while currentmainhas since advancedlibSceNet/Export.cppanddocs/dev/debt/libSceNet.md, both files changed here. The PR’s integration run is based onb7a451d, not current main. Please refresh on current main, preserve the already-merged queue-length and network changes inExport.cpp, and rerun the focused socket-info tests on the refreshed head. TheKernelDescribeSocketowner lifetime and descriptor listing logic otherwise look sound in this pass; I found no separate defect.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T05:43:34Z.
Review: CHANGES_REQUESTED
Please rebase/merge current main and rerun the focused
guest_sce_netcoverage. The branch is 264 commits behind (merge base895f47f4), and current main has intervening edits in bothlibSceNet/Export.cppanddocs/dev/debt/libSceNet.md, which this PR changes. The reported 8/8 Windows + WSL2 integration run is useful and covers the dependency network changes, but used mainb7a451d, so it does not validate this PR integrated with today’ssceNetGetSockInfoqueue-length and related network updates. Current-main diff-check and conventions pass; this request is specifically for resolving those shared-file updates and retesting the final head.