Resolver ids counted up from 0x100, which overlaps the socket numbers
libkernel hands out below 1024. With resolvers now registered in epolls
next to sockets, a socket numbered like a live resolver was taken for the
resolver by sceNetEpollControl, skipped by sceNetEpollWait and dropped
by sceNetResolverDestroy. A resolver now takes the lowest free id from
1024 to 0x3fff, between the socket numbers and the epoll ids.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A raw socket created with a nonzero protocol returns the protocol of the entry FreeBSD selects: the requested number for the raw protocols listed in in_proto.c and in6_proto.c, or zero from the raw wildcard entry otherwise. A raw socket created with protocol 0 still throws because its selection is not mapped; FreeBSD accepts that socket through pffindtype, so this is an unsupported path here rather than a console rejection.
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.