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
f6382369
Commit
f6382369
authored
Sep 19, 2011
by
Geoff Garside
Committed by
antirez
Jul 11, 2013
Browse files
Add static anetV6Only() function.
This function sets the IPV6_V6ONLY option to 1 to use separate stack IPv6 sockets.
parent
71795d4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/anet.c
View file @
f6382369
...
...
@@ -362,6 +362,16 @@ static int anetListen(char *err, int s, struct sockaddr *sa, socklen_t len) {
return
ANET_OK
;
}
static
int
anetV6Only
(
char
*
err
,
int
s
)
{
int
yes
=
1
;
if
(
setsockopt
(
s
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
yes
,
sizeof
(
yes
))
==
-
1
)
{
anetSetError
(
err
,
"setsockopt: %s"
,
strerror
(
errno
));
close
(
s
);
return
ANET_ERR
;
}
return
ANET_OK
;
}
int
anetTcpServer
(
char
*
err
,
int
port
,
char
*
bindaddr
)
{
int
s
,
rv
;
...
...
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