From 63351443927dd1e5eefe82d10162175ea1fdb8d2 Mon Sep 17 00:00:00 2001 From: AdamN <7974720+anr2me@users.noreply.github.com> Date: Thu, 9 Jan 2025 16:39:45 +0700 Subject: [PATCH] Only do address replacement when built-in Adhoc Server is enabled. --- Core/HLE/sceNetInet.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceNetInet.cpp b/Core/HLE/sceNetInet.cpp index d926daa091..dc2b3fb168 100644 --- a/Core/HLE/sceNetInet.cpp +++ b/Core/HLE/sceNetInet.cpp @@ -588,8 +588,10 @@ static int sceNetInetBind(int socket, u32 namePtr, int namelen) { } // FIXME: On non-Windows broadcast to INADDR_BROADCAST(255.255.255.255) might not be received by the sender itself when binded to specific IP (ie. 192.168.0.2) or INADDR_BROADCAST. // Meanwhile, it might be received by itself when binded to subnet (ie. 192.168.0.255) or INADDR_ANY(0.0.0.0). - if (saddr.in.sin_addr.s_addr == INADDR_ANY || saddr.in.sin_addr.s_addr == INADDR_BROADCAST) { - // Replace INADDR_ANY with a specific IP in order not to send data through the wrong interface (especially during broadcast) + // + // Replace INADDR_ANY (and INADDR_BROADCAST too) with a specific IP (using AdhocServer IP address as reference) in order not to send data through the wrong interface (especially during broadcast), + // But let's do this only when using built-in Adhoc Server, otherwise UNO won't works + if (g_Config.bEnableAdhocServer && (saddr.in.sin_addr.s_addr == INADDR_ANY || saddr.in.sin_addr.s_addr == INADDR_BROADCAST)) { // Get Local IP Address sockaddr_in sockAddr{}; getLocalIp(&sockAddr);