Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
0b4d5b09
Commit
0b4d5b09
authored
Oct 21, 2009
by
Niels Möller
Browse files
(make_lshd_port): Set the IPPROTO_IPV6ONLY socket
option when listening on an IPv6 socket. Rev: src/lshd.c:1.187
parent
16bcebaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lshd.c
View file @
0b4d5b09
...
...
@@ -325,6 +325,14 @@ make_lshd_port(struct lshd_context *ctx, socklen_t addr_len, struct sockaddr *ad
if
(
setsockopt
(
fd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
yes
,
sizeof
(
yes
))
<
0
)
werror
(
"setsockopt SO_REUSEADDR failed: %e.
\n
"
,
errno
);
#if WITH_IPV6
if
(
addr
->
sa_family
==
AF_INET6
)
{
if
(
setsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_V6ONLY
,
&
yes
,
sizeof
(
yes
))
<
0
)
werror
(
"setsockopt IPV6_V6ONLY failed: %e.
\n
"
,
errno
);
}
#endif
if
(
bind
(
fd
,
addr
,
addr_len
)
<
0
)
{
werror
(
"bind failed: %e.
\n
"
,
errno
);
...
...
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