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
7b2d32d9
Commit
7b2d32d9
authored
Sep 18, 2014
by
Yossi Gottlieb
Committed by
antirez
Sep 19, 2014
Browse files
Unix domain sockets incorrectly listed as IPv6.
parent
015cbf30
Changes
1
Show whitespace changes
Inline
Side-by-side
src/anet.c
View file @
7b2d32d9
...
...
@@ -539,10 +539,13 @@ int anetPeerToString(int fd, char *ip, size_t ip_len, int *port) {
struct
sockaddr_in
*
s
=
(
struct
sockaddr_in
*
)
&
sa
;
if
(
ip
)
inet_ntop
(
AF_INET
,(
void
*
)
&
(
s
->
sin_addr
),
ip
,
ip_len
);
if
(
port
)
*
port
=
ntohs
(
s
->
sin_port
);
}
else
{
}
else
if
(
sa
.
ss_family
==
AF_INET6
)
{
struct
sockaddr_in6
*
s
=
(
struct
sockaddr_in6
*
)
&
sa
;
if
(
ip
)
inet_ntop
(
AF_INET6
,(
void
*
)
&
(
s
->
sin6_addr
),
ip
,
ip_len
);
if
(
port
)
*
port
=
ntohs
(
s
->
sin6_port
);
}
else
{
if
(
ip
)
ip
[
0
]
=
'\0'
;
if
(
port
)
*
port
=
0
;
}
return
0
;
}
...
...
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