Repository navigation
feat(libSceNet): implement sceNetInitParam and the loopback answer of sceNetConfigGetIfFlags - #10881
Conversation
sceNetInitParam initializes the library as sceNetInit does and returns its result. NetInitializeParameter's layout is unknown, so its fields are not read; a null parameter throws because its console result is unknown.
sceNetConfigGetIfFlags answers interface 0, lo0 in the sceNetGetIfName numbering, with IFF_UP | IFF_LOOPBACK | IFF_RUNNING | IFF_MULTICAST, the flags FreeBSD 11 gives a configured loopback. Other interfaces and a null flags pointer throw: the library models no other interface.
Progress report (14c99b5 → 6f37718)📈 System libraries: 50.57% (+0.01%, +2 implemented functions) ✅ 2 implemented
Changed libraries (implemented exports)
|
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
The local tests and the cited FreeBSD 11 source establish the chosen host model, but the core console behavior remains unverified: both the |
|
On the PS5 evidence question: I checked both calls against firmware 13.42
So ignoring the contents loses nothing main models today, since main's
|
|
@BunnyFl thank you, that answers it. |
…ags as measured BunnyFl measured both calls in firmware 13.42 libSceNet.sprx, run in an emulator on the module itself. sceNetInitParam returns 0x80410116 for a null parameter. The first non-null call copies the first 32 bytes of the parameter and returns 0, and every later call returns 0x80410110, with a null parameter and after sceNetTerm too, because the flag is never cleared. sceNetConfigGetIfFlags returns 0x8041130E for a null flags pointer before anything else. Both replace throws that stood in for the unknown answers. The first successful sceNetInitParam still marks the library initialized, as sceNetInit does here, because the other calls check it. The module reads only bit 0 of the stored copy's first word, to raise the pool limit of sceNetPoolCreate from 32 to 128; that limit is recorded as not modelled, as sceNetPoolCreate here has none.
|
@EagleBearerYS Thanks, the One test change: in For 10 and |
…e number of 10 or more Firmware 13.42's module looks the name up with sceNetGetIfName, which has none past 9, then issues SIOCGIFFLAGS on the empty name. That ioctl fails, and the call returns -1 with the flags untouched. Return the same instead of throwing. Interfaces 1 to 9 still throw, and the test no longer asserts that for 1 and 4, which the console answers from the kernel. Asked for in oneandonlydean's review, from BunnyFl's read of the module.
|
@oneandonlydean Thanks. Done in 6f37718: 1 and 4 are out of the loop, and an interface number of 10 or more now returns -1 with the flags untouched, as BunnyFl read it; the test asserts that for 10 and |
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.guest_sce_netpasses 10 runs in a row, and fails with e9db171'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.main2b52256 (run). KernelPanicNT's fix(libSceNet): reject the flags and names the module rejects #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;main88f9967 fails 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.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 bf0f293'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 at bf0f293, 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)