diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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. */ |