sceNetResolverCreate returns EINVAL for any non-zero flags, as the
module is read in prosper. The new entry says so and that no direct call
in the titles checked passes a non-zero value.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
rooklz read sceNetConfigGetDefaultRoute (NID lFJb+BlPK1c, wrapper at
0x153f0) in libSceNet.sprx. Before sceNetInit it returns 0x804101C8
with errno 200. Without a default route it returns 0x8041130C and
leaves the output alone. With one it stores the route and returns 1,
not 0. The wrapper never checks the output pointer.
The not-initialized answer reads the library's sceNetInit/sceNetTerm
flag through fail(), as the other exports do. The route is still the
host gateway. A null output with a route throws std::invalid_argument,
where the module faults.
Co-authored-by: rooklz <[email protected]>
rooklz read sceNetInetNtopWithScopeId (FUN_00006be0) and
sceNetInetPtonWithScopeId (FUN_000072d0) in libSceNet.sprx. The zone
after '%' is one of the ten interface names, never a number, and ntop
prints the name of the interface whose index is the scope. A null
address or text and a short buffer set ENOSPC, and another family sets
EAFNOSUPPORT. Pton reads a zone only when the scope output is not null,
and answers another family with EAFNOSUPPORT and a null text with
EINVAL.
The host has none of these interfaces. Names and indexes go through the
interface table and host-index mapping of rooklz's "feat(net): resolve
interface ids to host indexes", taken with the same text so the two
changes merge without conflict there. A null destination throws
std::invalid_argument, where the module faults.
Co-authored-by: rooklz <[email protected]>
sceNetResolverStartNtoa refuses a timeout from 1 to 999999 with EINVAL
before the resolver is looked up, and takes 0 as 1000000, as a run of
firmware 13.42's module shows.
The entry says the IPv6 text conversion of both exports is unverified on a
console. Add how the 53 locally run titles call them: 36 titles call
sceNetInetPton at 107 call sites and 22 call sceNetInetNtop at 67, and every
call site loads the family 2 (AF_INET) into the first argument; none loads 28
(AF_INET6). Read from the instructions of the titles' own executables, not
measured.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
sceNetGetStatisticsInfo threw NotImplemented_nid_no_patch. It now fills
the six 32-bit fields of the statistics block (kernel memory free and
minimum free, packet count, QoS packet count, library memory free and
minimum free) and fails with NET_EFAULT, setting errno, for a null
pointer. The layout and the "plenty free, nothing queued" answer follow
shadPS4's net.cpp and net_types.h; the host has no counter for the
console's network memory, so the values are not measured. The debt file
records this, and the test checks the null pointer, the field
invariants and that the flags argument is ignored.
sceNetShowIfconfigWithMemory, sceNetShowPolicyWithMemory and
sceNetShowRoute6WithMemory threw NotImplemented_nid_no_patch. They now
behave like the existing sceNetShowRouteWithMemory: an unknown memory
pool id fails with NET_EBADF (errno set), a live pool returns success
without printing. The behaviour follows shadPS4's net.cpp, which does
the same for these three. The new silent stubs are listed in the
libSceNet technical debt file, and the tests cover the invalid id, live
pool and destroyed pool cases.
Since #9137 both throw after sceNetInit. A PS5 on firmware 13.40
returns 0 from each and prints plain-text tables to stdout. They now
print the console's layout with what the emulator knows: ifconfig an
eth0 block from the host interface sceNetCtlGetInfo reports (the same
MAC, address, netmask and MTU), the console's lo0 block and the DNS
servers; netstat the header and one entry per socket and epoll of the
title, with the self and non-blocking flags, addresses, buffer sizes and
the names given to sceNetSocket and sceNetEpollCreate, which are now
kept. The debt entry lists what the console prints that is left out.
guest_sce_net captures both outputs: the lo0 block and DNS section, a
named unbound UDP socket, a non-blocking listening TCP socket bound to
127.0.0.1, an epoll, a 40-character name cut to 31, and the entries gone
after close.
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.