fix(libSceNetCtl): answer sceNetCtlGetInfo from the host IPv4 interface #5056
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5056"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by 0xRickx on 2026-10-13T10:01:44Z.
What
sceNetCtlGetStatereportsIPOBTAINEDwhen the host has an address, butsceNetCtlGetInforeturnedSCE_NET_CTL_ERROR_NOT_CONNECTEDfor every code. A title that saw a connected console and then asked for its address, netmask or MTU got an error back.Prospero Explorer (PPSA99109) shows this on
main. Its System information > Network tab (DashboardScreen.cs) reads Stateconnected, then-for Address, Subnet mask, Gateway, Primary name server and Hardware address, and0 bytesfor Largest packet (#5071).PS5VR (PPSA99177) also builds the link under its QR code from code 14 (
vr_sources.cpp), but it does not reach that screen yet.sceNetCtlGetInfonow answers from the host interface that holds an IPv4 address, preferring the one that carries the default route:/proc/net/route.IP_ADDRESS, 15NETMASK, 16DEFAULT_ROUTE, 3MTUPRIMARY_DNS, 18SECONDARY_DNS/etc/resolv.conf)DEVICE, 4LINK, 11IP_CONFIG, 19HTTP_PROXY_CONFIGETHER_ADDRsceNetGetMacAddressalready reportsnetctl.hand onionHEN's PS5net_ctl.h.NetCtl.csdocuments this.inforeturnsSCE_NET_CTL_ERROR_INVALID_ADDR(0x80412107). A code outside 1..21 returnsSCE_NET_CTL_ERROR_INVALID_CODE(0x80412106, from EA DirtySDK's PS4 error tabledirtyerrps4.c), checked in the same order as KytyPS5.NOT_CONNECTED, as before.NOT_CONNECTED.IP_CONFIG,DEVICEandIP_ADDRESS(netconnps4.cpp,dirtynetps4.c), so all three are answered rather than thrown.sceNetCtlGetStateandsceNetCtlGetIfStatstill count IPv6 addresses. On a host with only IPv6,GetStatereportsIPOBTAINEDwhileGetInforeturnsNOT_CONNECTED.The fixed answers and the
0.0.0.0used for a missing gateway or DNS server are listed indocs/dev/debt/libSceNetCtl.md.Tested
Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release,
mainbb9a4d8a(rebased onto77b9f727afterwards, no conflicts):New
guest_net_ctltest:It aborts on
mainand passes with the change.Both platforms report the same values as the host tools:
ipconfigshows for the adapter with the default route, and skips a VirtualBox host-only adapter.eth0from the default route and skips three docker bridges.guest_sce_netandpatched_librariespass. Full ctest: 1052/1052 passed (8 skipped on this machine).Prospero Explorer (PPSA99109, catalog 01.000.000), relinked, opened on System information > Network with
APS5_PAD_INPUT_FILE(steps in #5071) and captured withAPS5_DUMP_FRAMES:mainae244d52The host's
ipconfigshows the same address, mask, gateway and DNS server.ProsperoLichess (PPSA99009, catalog 01.000.000), relinked with this
main, logs[PCH] lan ip 192.168.178.22with and without the change. WhensceNetCtlGetInfofails it falls back to a connected UDP socket's local address, so the answers agree.tools/check_conventions.py --base upstream/mainpasses.Rebased onto
mainffa2a6ecwithout conflicts (head3065b892), then tested again onmainc496fd53:guest_net_ctl,guest_sce_netandpatched_librariespass. Full ctest: 1088/1088 passed (8 skipped on this machine).guest_net_ctl,guest_sce_netandpatched_librariespass.guest_math,agc_driver_depth_compare_copyandguest_socket_read_writefail the same way onmainb8683834without any of them in this setup.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T17:37:43Z.
Checked the build and ctest (
guest_net_ctlpasses, and fails without the change), the argument errors and code ranges against KytyPS5 and shadPS4, and the test registration and debt entry; merging once the full Build is green.