sceNetEpollCreate fails with EINVAL for a null name or non-zero flags,
sceNetResolverCreate and sceNetGetMacAddress for non-zero flags, and
sceNetResolverStartNtoa, before any other check, for a negative timeout
or retry count or a flag bit outside 0x10001, as prosper reads the
libSceNet module. The two accepted resolver flag bits are still ignored,
which the debt file now records.
Apply the firmware 13.42 module-probe report in PR #9506: all four DNS calls check initialization first; getters return EINVAL for null outputs or nonzero flags; setters reject flags before reading guest memory. Keep the checked input copy and document EFAULT as host safety, not firmware behavior. Use the current public Net.hpp declarations in the regression.
Rebased onto upstream e7e3e9c198. Ubuntu 24.04, GCC 13.3, Release: actual libc/libkernel/libSceNet libraries and both focused test executables built. guest_sce_net passes. A separate harness linked against those unmodified libraries passes initialization, errno, invalid flags, unreadable-input flag precedence, null clearing and unchanged-output checks. The full guest_net_dns_info test is blocked here: process_vm_readv is denied with EPERM by the execution environment. No full DNS regression pass is claimed. Public-header audit, conventions, test registration and whitespace checks pass.
The resolver still uses host DNS; IPv6 host-server discovery and firmware server-count behavior remain debt. Firmware evidence: https://github.com/boykopovar/AnyPS5/pull/9506#issuecomment-6390574180
AI-assisted: yes
Main's #10706 removes the local declarations at the top of libSceNet's
Export.cpp, where this branch had added __inet_pton and __inet_ntop.
libkernel's Api.hpp, which Export.cpp includes, now declares both, so the
merge takes main's side there.
After sceNetInit, the console's sceNetUsleep prints
"[LIBNET] usleep <count>" to standard output for a negative count
before failing with EINVAL, as a payload measured on firmware 13.60
(#9076). AnyPS5 failed without printing it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On macOS, shutdown(SHUT_RD) on a UDP socket that was never bound does not
wake a thread blocked in recv on it, so sceNetShutdown left the receiver
hanging. Use the receive wait that Windows already has: block on the
socket table until the socket gets a local port or is shut, then poll.
On macOS an unbound socket reports port 0 from getsockname, so the check
looks at the port instead of the Winsock error.
Ported from #8658.
Co-authored-by: Himansh Raj <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNetConnect dissolves a datagram association with the same host call sequence as connect (disconnect_datagram in Export.cpp). The sceNetConnect-to-AF_UNSPEC debt entry only described Linux. On Windows a socket bound to an explicit address keeps it in the same way, and a sendto on the host socket to a non-loopback address fails with Winsock error 10051, where FreeBSD's udp_disconnect() resets the local address.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>