aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs
index 32346dc7..a07fc518 100644
--- a/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs
+++ b/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs
@@ -245,6 +245,15 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
{
string host = MemoryHelper.ReadAsciiString(context.Memory, inputBufferPosition, (int)inputBufferSize);
+ if (!context.Device.Configuration.EnableInternetAccess)
+ {
+ Logger.Info?.Print(LogClass.ServiceSfdnsres, $"Guest network access disabled, DNS Blocked: {host}");
+
+ WriteResponse(context, withOptions, 0, GaiError.NoData, NetDbError.HostNotFound);
+
+ return ResultCode.Success;
+ }
+
// TODO: Use params.
bool enableNsdResolve = (context.RequestData.ReadInt32() & 1) != 0;
int timeOut = context.RequestData.ReadInt32();
@@ -331,6 +340,15 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
ulong optionsBufferPosition,
ulong optionsBufferSize)
{
+ if (!context.Device.Configuration.EnableInternetAccess)
+ {
+ Logger.Info?.Print(LogClass.ServiceSfdnsres, $"Guest network access disabled, DNS Blocked.");
+
+ WriteResponse(context, withOptions, 0, GaiError.NoData, NetDbError.HostNotFound);
+
+ return ResultCode.Success;
+ }
+
byte[] rawIp = new byte[inputBufferSize];
context.Memory.Read(inputBufferPosition, rawIp);
@@ -442,6 +460,15 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres
string host = MemoryHelper.ReadAsciiString(context.Memory, context.Request.SendBuff[0].Position, (long)context.Request.SendBuff[0].Size);
string service = MemoryHelper.ReadAsciiString(context.Memory, context.Request.SendBuff[1].Position, (long)context.Request.SendBuff[1].Size);
+ if (!context.Device.Configuration.EnableInternetAccess)
+ {
+ Logger.Info?.Print(LogClass.ServiceSfdnsres, $"Guest network access disabled, DNS Blocked: {host}");
+
+ WriteResponse(context, withOptions, 0, GaiError.NoData, NetDbError.HostNotFound);
+
+ return ResultCode.Success;
+ }
+
// NOTE: We ignore hints for now.
DeserializeAddrInfos(context.Memory, (ulong)context.Request.SendBuff[2].Position, (ulong)context.Request.SendBuff[2].Size);