Compare commits
1 commit
8adcbc3482
...
d264a38fd4
Author | SHA1 | Date | |
---|---|---|---|
d264a38fd4 |
1 changed files with 3 additions and 15 deletions
|
@ -53,19 +53,6 @@ enum class NetDbError : s32 {
|
||||||
NoData = 4,
|
NoData = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const constexpr std::array blockedDomains = {"srv.nintendo.net",
|
|
||||||
"battle.net",
|
|
||||||
"microsoft.com",
|
|
||||||
"mojang.com",
|
|
||||||
"xboxlive.com",
|
|
||||||
"minecraftservices.com"};
|
|
||||||
|
|
||||||
static bool IsBlockedHost(const std::string& host) {
|
|
||||||
return std::any_of(
|
|
||||||
blockedDomains.begin(), blockedDomains.end(),
|
|
||||||
[&host](const std::string& domain) { return host.find(domain) != std::string::npos; });
|
|
||||||
}
|
|
||||||
|
|
||||||
static NetDbError GetAddrInfoErrorToNetDbError(GetAddrInfoError result) {
|
static NetDbError GetAddrInfoErrorToNetDbError(GetAddrInfoError result) {
|
||||||
// These combinations have been verified on console (but are not
|
// These combinations have been verified on console (but are not
|
||||||
// exhaustive).
|
// exhaustive).
|
||||||
|
@ -167,7 +154,7 @@ static std::pair<u32, GetAddrInfoError> GetHostByNameRequestImpl(HLERequestConte
|
||||||
// For now, ignore options, which are in input buffer 1 for GetHostByNameRequestWithOptions.
|
// For now, ignore options, which are in input buffer 1 for GetHostByNameRequestWithOptions.
|
||||||
|
|
||||||
// Prevent resolution of Nintendo servers
|
// Prevent resolution of Nintendo servers
|
||||||
if (IsBlockedHost(host)) {
|
if (host.find("srv.nintendo.net") != std::string::npos) {
|
||||||
LOG_WARNING(Network, "Resolution of hostname {} requested, returning EAI_AGAIN", host);
|
LOG_WARNING(Network, "Resolution of hostname {} requested, returning EAI_AGAIN", host);
|
||||||
return {0, GetAddrInfoError::AGAIN};
|
return {0, GetAddrInfoError::AGAIN};
|
||||||
}
|
}
|
||||||
|
@ -284,7 +271,7 @@ static std::pair<u32, GetAddrInfoError> GetAddrInfoRequestImpl(HLERequestContext
|
||||||
const std::string host = Common::StringFromBuffer(host_buffer);
|
const std::string host = Common::StringFromBuffer(host_buffer);
|
||||||
|
|
||||||
// Prevent resolution of Nintendo servers
|
// Prevent resolution of Nintendo servers
|
||||||
if (IsBlockedHost(host)) {
|
if (host.find("srv.nintendo.net") != std::string::npos) {
|
||||||
LOG_WARNING(Network, "Resolution of hostname {} requested, returning EAI_AGAIN", host);
|
LOG_WARNING(Network, "Resolution of hostname {} requested, returning EAI_AGAIN", host);
|
||||||
return {0, GetAddrInfoError::AGAIN};
|
return {0, GetAddrInfoError::AGAIN};
|
||||||
}
|
}
|
||||||
|
@ -372,4 +359,5 @@ void SFDNSRES::ResolverSetOptionRequest(HLERequestContext& ctx) {
|
||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
rb.Push<s32>(0); // bsd errno
|
rb.Push<s32>(0); // bsd errno
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Service::Sockets
|
} // namespace Service::Sockets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue