|
|
@@ -323,9 +323,14 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
|
|
|
|
|
|
int value = optionValue.Length >= 4 ? MemoryMarshal.Read<int>(optionValue) : MemoryMarshal.Read<byte>(optionValue);
|
|
|
|
|
|
- if (option == BsdSocketOption.SoLinger)
|
|
|
+ if (level == SocketOptionLevel.Socket && option == BsdSocketOption.SoLinger)
|
|
|
{
|
|
|
- int value2 = MemoryMarshal.Read<int>(optionValue[4..]);
|
|
|
+ int value2 = 0;
|
|
|
+
|
|
|
+ if (optionValue.Length >= 8)
|
|
|
+ {
|
|
|
+ value2 = MemoryMarshal.Read<int>(optionValue[4..]);
|
|
|
+ }
|
|
|
|
|
|
Socket.SetSocketOption(level, SocketOptionName.Linger, new LingerOption(value != 0, value2));
|
|
|
}
|