Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
e1da7241
Unverified
Commit
e1da7241
authored
Apr 04, 2023
by
gx
Committed by
GitHub
Apr 04, 2023
Browse files
Fix local clients detection (#11664)
Match 127.0.0.0/8 instead of just `127.0.0.1` to detect the local clients.
parent
aee8d1ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/socket.c
View file @
e1da7241
...
@@ -341,7 +341,7 @@ static int connSocketIsLocal(connection *conn) {
...
@@ -341,7 +341,7 @@ static int connSocketIsLocal(connection *conn) {
if
(
connSocketAddr
(
conn
,
cip
,
sizeof
(
cip
)
-
1
,
NULL
,
1
)
==
C_ERR
)
if
(
connSocketAddr
(
conn
,
cip
,
sizeof
(
cip
)
-
1
,
NULL
,
1
)
==
C_ERR
)
return
-
1
;
return
-
1
;
return
!
strcmp
(
cip
,
"127.
0.0.1"
)
||
!
strcmp
(
cip
,
"::1"
);
return
!
str
n
cmp
(
cip
,
"127.
"
,
4
)
||
!
strcmp
(
cip
,
"::1"
);
}
}
static
int
connSocketListen
(
connListener
*
listener
)
{
static
int
connSocketListen
(
connListener
*
listener
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment