From b7fb474bfec178c28e37e8ccb3744a2e8a706407 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Mon, 11 Jul 2022 23:50:01 +0100 Subject: [PATCH] Handle the case where byte optionValues are sent to BSD (#3405) Some games and the Mario Odyssey Multiplayer mod do this. The SMO multiplayer mod also needs you to revert #3394 as it uses a blocking socket to receive (otherwise it hangs), and it doesn't seem to like being forced as non-blocking. --- Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs index 349dbde0a6..43172ab4cf 100644 --- a/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs +++ b/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocket.cs @@ -304,7 +304,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd return LinuxError.EOPNOTSUPP; } - int value = MemoryMarshal.Read(optionValue); + int value = optionValue.Length >= 4 ? MemoryMarshal.Read(optionValue) : MemoryMarshal.Read(optionValue); if (option == BsdSocketOption.SoLinger) {