diff options
author | Damien Miller <djm@mindrot.org> | 2008-01-19 22:56:00 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2008-01-19 22:56:00 +0100 |
commit | 49d2a2826aec4c0aba41ea76b1bb7fa446d6fd55 (patch) | |
tree | 4dc9693dddcce2345a56fa36b993f84bbda5545a /sshd.c | |
parent | - (djm) Silence noice from expr in ssh-copy-id; patch from (diff) | |
download | openssh-49d2a2826aec4c0aba41ea76b1bb7fa446d6fd55.tar.xz openssh-49d2a2826aec4c0aba41ea76b1bb7fa446d6fd55.zip |
- (djm) Only listen for IPv6 connections on AF_INET6 sockets; patch from
tsr2600 AT gmail.com
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) &on, sizeof(on)) == -1) error("setsockopt SO_REUSEADDR: %s", strerror(errno)); +#ifdef IPV6_V6ONLY + /* Only communicate in IPv6 over AF_INET6 sockets. */ + if (ai->ai_family == AF_INET6) { + if (setsockopt(listen_sock, IPPROTO_IPV6, IPV6_V6ONLY, + &on, sizeof(on)) == -1) + error("setsockopt IPV6_V6ONLY: %s", + strerror(errno)); + } +#endif + debug("Bind to port %s on %s.", strport, ntop); /* Bind the socket to the desired port. */ |