Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
6c68b07a
There was an error fetching the commit references. Please try again later.
Commit
6c68b07a
authored
1 year ago
by
Liam
Browse files
Options
Downloads
Patches
Plain Diff
sfdnsres: ensure lp1 is not resolved
parent
ada46973
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/hle/service/sockets/nsd.cpp
+9
-2
9 additions, 2 deletions
src/core/hle/service/sockets/nsd.cpp
src/core/hle/service/sockets/sfdnsres.cpp
+12
-0
12 additions, 0 deletions
src/core/hle/service/sockets/sfdnsres.cpp
with
21 additions
and
2 deletions
src/core/hle/service/sockets/nsd.cpp
+
9
−
2
View file @
6c68b07a
...
...
@@ -19,6 +19,12 @@ enum class ServerEnvironmentType : u8 {
Dp
,
};
// This is nn::nsd::EnvironmentIdentifier
struct
EnvironmentIdentifier
{
std
::
array
<
u8
,
8
>
identifier
;
};
static_assert
(
sizeof
(
EnvironmentIdentifier
)
==
0x8
);
NSD
::
NSD
(
Core
::
System
&
system_
,
const
char
*
name
)
:
ServiceFramework
{
system_
,
name
}
{
// clang-format off
static
const
FunctionInfo
functions
[]
=
{
...
...
@@ -101,8 +107,9 @@ void NSD::ResolveEx(HLERequestContext& ctx) {
}
void
NSD
::
GetEnvironmentIdentifier
(
HLERequestContext
&
ctx
)
{
const
std
::
string
environment_identifier
=
"lp1"
;
ctx
.
WriteBuffer
(
environment_identifier
);
constexpr
EnvironmentIdentifier
lp1
=
{
.
identifier
=
{
'l'
,
'p'
,
'1'
,
'\0'
,
'\0'
,
'\0'
,
'\0'
,
'\0'
}};
ctx
.
WriteBuffer
(
lp1
);
IPC
::
ResponseBuilder
rb
{
ctx
,
2
};
rb
.
Push
(
ResultSuccess
);
...
...
This diff is collapsed.
Click to expand it.
src/core/hle/service/sockets/sfdnsres.cpp
+
12
−
0
View file @
6c68b07a
...
...
@@ -150,6 +150,12 @@ static std::pair<u32, GetAddrInfoError> GetHostByNameRequestImpl(HLERequestConte
const
std
::
string
host
=
Common
::
StringFromBuffer
(
host_buffer
);
// For now, ignore options, which are in input buffer 1 for GetHostByNameRequestWithOptions.
// Prevent resolution of Nintendo servers
if
(
host
.
find
(
"srv.nintendo.net"
)
!=
std
::
string
::
npos
)
{
LOG_WARNING
(
Network
,
"Resolution of hostname {} requested, returning EAI_AGAIN"
,
host
);
return
{
0
,
GetAddrInfoError
::
AGAIN
};
}
auto
res
=
Network
::
GetAddressInfo
(
host
,
/*service*/
std
::
nullopt
);
if
(
!
res
.
has_value
())
{
return
{
0
,
Translate
(
res
.
error
())};
...
...
@@ -261,6 +267,12 @@ static std::pair<u32, GetAddrInfoError> GetAddrInfoRequestImpl(HLERequestContext
const
auto
host_buffer
=
ctx
.
ReadBuffer
(
0
);
const
std
::
string
host
=
Common
::
StringFromBuffer
(
host_buffer
);
// Prevent resolution of Nintendo servers
if
(
host
.
find
(
"srv.nintendo.net"
)
!=
std
::
string
::
npos
)
{
LOG_WARNING
(
Network
,
"Resolution of hostname {} requested, returning EAI_AGAIN"
,
host
);
return
{
0
,
GetAddrInfoError
::
AGAIN
};
}
std
::
optional
<
std
::
string
>
service
=
std
::
nullopt
;
if
(
ctx
.
CanReadBuffer
(
1
))
{
const
std
::
span
<
const
u8
>
service_buffer
=
ctx
.
ReadBuffer
(
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment