feat(libSceNet): implement sceNetInitParam and the loopback answer of sceNetConfigGetIfFlags #10881
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10881"
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-25T07:10:41Z.
What
Two libSceNet calls stop throwing:
sceNetInitParamfollows libSceNet's own code on firmware 13.42, as BunnyFl measured it (comment): a null parameter returns 0x80410116 (errno 22); the first non-null call stores the parameter's first 32 bytes and returns 0; every later call returns 0x80410110 (errno 16), a null parameter and a call aftersceNetTermincluded. The first success also marks the library initialized, which main's other calls check. The one field the module reads, bit 0 of the first word, raisessceNetPoolCreate's limit from 32 to 128 pools; main'ssceNetPoolCreatehas no limit, so the bit is stored but not modelled.sceNetConfigGetIfFlagsanswers interface 0 (lo0in thesceNetGetIfNamenumbering) withIFF_UP | IFF_LOOPBACK | IFF_RUNNING | IFF_MULTICAST(0x8049). That is what FreeBSD 11 reports for a configured loopback:lo_clone_createandloioctlinsys/net/if_loop.c, withif_flags | if_drv_flagsasSIOCGIFFLAGSbuilds it insys/net/if.c. A nullflagspointer returns 0x8041130E before anything else, as measured on 13.42 (comment). Interfaces 1 to 9 throw, because their flags come from the kernel and the library models no other interface. A number of 10 or more returns -1 and leavesflagsuntouched, as the module does whensceNetGetIfNamehas no name for it andSIOCGIFFLAGSfails on the empty one (comment); the errno it sets isn't modelled.Both are recorded under Unknown function info in
docs/dev/debt/libSceNet.md.Related: #9578 (which adds the libSceNetCtl host-gateway hook an
eth0answer would sit beside) and #9515 also editlibSceNet/Export.cpp; this merges cleanly with both.Tested
guest_sce_netpasses 10 of 10 on Linux and on Windows, 0 skipped.be3f208b02(run), the commit that follows the measurement:guest_sce_netpasses 10 runs in a row, and fails with e9db171018's code. Linux: 1 run, 1 pass, 0 skip, 0 fail. Windows: 1 run, 1 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (144 and 207) and on Windows (171 and 223). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.guest_sce_netgainsCheckInitParamandCheckIfFlags. Each aborts with its commit's product change reverted (1 of 1 per commit) and passes with it.bf0f293edd, a merge ofmain2b5225605b(run). KernelPanicNT's #9727 addsCheckRejectedArguments()toGuestSceNet.cpp'smainright where this PR addsCheckIfFlags(); the merge keeps both, and nothing else conflicted. This PR's changed lines are the same as before the merge.guest_sce_netpasses 10 runs in a row, and fails on the before arm. Linux: 1 run, 1 pass, 0 skip, 0 fail. Windows: 1 run, 1 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (144 and 209), and libc passes on Windows (171). Windows' libkernel suite runs 227 tests and failsguest_timed_join_import_libkernel_sysandguest_timed_join_import_libkernel_web, which this PR doesn't touch;main88f99678bffails the same two in this verify's Windows job (run), andmain's own Windows CI passes them. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.6f3771820a, after oneandonlydean's review (run):sceNetConfigGetIfFlagsreturns -1 withflagsuntouched for an interface number of 10 or more, as BunnyFl's read of the module shows, instead of throwing.CheckIfFlagsasserts that for 10 and0xffffffff, and no longer asserts that interfaces 1 and 4 (eth0 and wlan0) throw.guest_sce_netpasses 10 runs in a row, and fails with bf0f293edd's code. Linux: 1 run, 1 pass, 0 skip, 0 fail. Windows: 1 run, 1 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (144 and 209), and libc passes on Windows (171). Windows' libkernel suite runs 227 tests and failsguest_timed_join_import_libkernel_sysandguest_timed_join_import_libkernel_web, the same two as atbf0f293edd, which this PR doesn't touch (main's run). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.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)