Files
AnyPS5/docs/dev/debt/libSceNetCtl.md
T

8.2 KiB

libSceNetCtl technical debt

Silent stubs

  • sceNetCtlGetNatInfo (libSceNetCtl) - sceNetCtlGetNatInfo validates null pointers and returns SCE_NET_CTL_ERROR_NOT_CONNECTED (0x80412108) without performing NAT discovery.

Unknown function info

Functional

  • sceNetCtlCheckCallback (libSceNetCtl) - the state comes from the host interfaces, as in sceNetCtlGetState: IPOBTAINED (3) while the host has a non-loopback IPv4 or IPv6 address, DISCONNECTED (1) otherwise; the event values follow shadPS4, and no other event is delivered. Each callback registered with sceNetCtlRegisterCallback is called on the checking thread with its registration argument when the state differs from the last one it received, so a new registration receives the current state at the next check. This edge-triggered model follows KytyPS5; shadPS4 delivers the state on every check instead, and neither is measured on hardware. KytyPS5 calls the callbacks under its lock; here they are called after the lock is released, from a copy of their slots, so a sceNetCtlUnregisterCallback or sceNetCtlTerm on another thread that returns while a check is in flight does not stop that check from calling the callback once more with its old argument. Callbacks registered with sceNetCtlRegisterCallbackV6 keep their argument but receive no event, because no source says which call delivers them
  • sceNetCtlGetInfo (libSceNetCtl) finds the host's default route in /proc/net/route on Linux and, on macOS, in the routing table read with sysctl(NET_RT_FLAGS, RTF_GATEWAY), where an interface-scoped default route ranks after the unscoped one
  • sceNetCtlGetIfStat (libSceNetCtl) throws on macOS: an unprivileged process reads the interface byte counters (getifaddrs and sysctl(NET_RT_IFLIST2) alike) reduced to their low 32 bits, so a total would wrap every 4 GiB