mirror of
https://github.com/aydencharles/onionHEN.git
synced 2026-10-22 03:42:46 -05:00
get_ip_address had three independent implementations (shellui, util, daemon) because each module also carried its own copy of SceNetCtlInfo and its own prototype for sceNetCtlGetInfo, with the pointer typed as SceNetCtlInfo* in two of them and void* in the third. The shellui and util copies stored the result in an unsigned int and tested `ret < 0`, which is never true for an unsigned value. Their error branch was unreachable, so a failed lookup returned success, left not_connected clear, and copied an uninitialised SceNetCtlInfo to the caller instead of the IP NOT FOUND placeholder. util's rest-mode network-recovery retry keys off that return value and therefore never ran. Declare the netctl ABI once in source/include/ps5/net_ctl.h, add onion_net_get_ip_address to libonion_platform with an explicit buffer-size contract, and keep util's not_connected latch in util where it belongs. Cover the status mapping, the placeholder length and buffer validation with host tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>