diff --git a/core/libs/prx/libSceNet/Export.cpp b/core/libs/prx/libSceNet/Export.cpp index 29efb3e5523..e3d8b3c2258 100644 --- a/core/libs/prx/libSceNet/Export.cpp +++ b/core/libs/prx/libSceNet/Export.cpp @@ -995,7 +995,12 @@ int APS5_VABI sceNetSocket(const char* name, int family, int type, int protocol) } if (!initialize_sockets()) return fail(5); const NativeSocket native = ::socket(family == NET_AF_INET ? AF_INET : AF_INET6, type, protocol); - if (native == INVALID_NATIVE_SOCKET) return fail(native_error()); + if (native == INVALID_NATIVE_SOCKET) { +#ifdef __APPLE__ + if (errno == EPROTOTYPE) return fail(NET_EPROTONOSUPPORT); +#endif // __APPLE__ + return fail(native_error()); + } #ifdef _WIN32 u_long nonblocking = 1; if (ioctlsocket(native, FIONBIO, &nonblocking) != 0) { @@ -1972,6 +1977,13 @@ int APS5_VABI sceNetInetPton(int af, const char* src, void* dst) { return fail(NET_EINVAL); } const auto convert = [](int family, const std::string& text, unsigned char* address) { +#ifdef __APPLE__ + if (family == AF_INET) { + for (std::size_t i = 0; i + 1 < text.size(); ++i) { + if (text[i] == '0' && (i == 0 || text[i - 1] == '.') && text[i + 1] >= '0' && text[i + 1] <= '9') return 0; + } + } +#endif // __APPLE__ #ifdef _WIN32 return InetPtonA(family, text.c_str(), address); #else