mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Merge pull request #19836 from ANR2MERefork/inet_bind
An attempt to fix UNO single player.
This commit is contained in:
1 file changed
+4
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user