From 63af67138f9d7fe89fece9345123a209990f133b Mon Sep 17 00:00:00 2001 From: kjhq Date: Wed, 7 Oct 2026 10:43:24 +0000 Subject: [PATCH] feat(libSceNet): export in6addr_any and in6addr_loopback libSceNet exports the IPv6 wildcard and loopback addresses as data. --- core/libs/prx/libSceNet/Export.cpp | 3 +++ core/libs/tests/GuestSceNet.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/core/libs/prx/libSceNet/Export.cpp b/core/libs/prx/libSceNet/Export.cpp index 0b279067d..f8ceecf22 100644 --- a/core/libs/prx/libSceNet/Export.cpp +++ b/core/libs/prx/libSceNet/Export.cpp @@ -1058,4 +1058,7 @@ int APS5_VABI sceNetResolverStartNtoaMultipleRecords() { return 0; } +extern const std::uint8_t in6addr_any_nid_postfix[16] = {}; +extern const std::uint8_t in6addr_loopback_nid_postfix[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}; + } diff --git a/core/libs/tests/GuestSceNet.cpp b/core/libs/tests/GuestSceNet.cpp index 4bbb122ce..3e66f2437 100644 --- a/core/libs/tests/GuestSceNet.cpp +++ b/core/libs/tests/GuestSceNet.cpp @@ -9,6 +9,8 @@ #include extern "C" { +extern const std::uint8_t in6addr_any_nid_postfix[16]; +extern const std::uint8_t in6addr_loopback_nid_postfix[16]; int APS5_VABI sceNetInit_nid_postfix(void); int APS5_VABI sceNetSocket(const char*, int, int, int); int APS5_VABI sceNetBind_nid_postfix(int, const void*, std::uint32_t); @@ -143,6 +145,10 @@ static void CheckAddressText(int family, const char* text) { } int main() { + for (int i = 0; i < 16; ++i) { + Require(in6addr_any_nid_postfix[i] == 0); + Require(in6addr_loopback_nid_postfix[i] == (i == 15 ? 1 : 0)); + } Require(sceNetInit_nid_postfix() == 0); CheckAddressText(2, "127.0.0.1"); CheckAddressText(2, "255.255.255.255");