summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sshd.c b/sshd.c
index 9019411ac..27c38ba53 100644
--- a/sshd.c
+++ b/sshd.c
@@ -976,6 +976,16 @@ server_listen(void)
976 &on, sizeof(on)) == -1) 976 &on, sizeof(on)) == -1)
977 error("setsockopt SO_REUSEADDR: %s", strerror(errno)); 977 error("setsockopt SO_REUSEADDR: %s", strerror(errno));
978 978
979#ifdef IPV6_V6ONLY
980 /* Only communicate in IPv6 over AF_INET6 sockets. */
981 if (ai->ai_family == AF_INET6) {
982 if (setsockopt(listen_sock, IPPROTO_IPV6, IPV6_V6ONLY,
983 &on, sizeof(on)) == -1)
984 error("setsockopt IPV6_V6ONLY: %s",
985 strerror(errno));
986 }
987#endif
988
979 debug("Bind to port %s on %s.", strport, ntop); 989 debug("Bind to port %s on %s.", strport, ntop);
980 990
981 /* Bind the socket to the desired port. */ 991 /* Bind the socket to the desired port. */