diff options
author | Matt Johnston <matt@ucc.asn.au> | 2011-10-20 13:45:43 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2011-10-20 13:45:43 +0000 |
commit | 413fda92f15dfa9a82067dd7b4ed661b1612edd5 (patch) | |
tree | 5d74e341f78965712ded1d1c91ecae0a2fdc0658 | |
parent | 60943377ba4e6c90f1a8deb6a83bb957eb128b23 (diff) | |
download | dropbear-413fda92f15dfa9a82067dd7b4ed661b1612edd5.tar.gz |
Try bind IPV6_V6ONLY
-rw-r--r-- | dbutil.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -254,6 +254,16 @@ int dropbear_listen(const char* address, const char* port, linger.l_linger = 5; setsockopt(sock, SOL_SOCKET, SO_LINGER, (void*)&linger, sizeof(linger)); +#ifdef IPV6_V6ONLY + if (res->ai_family == AF_INET6) { + int on = 1; + if (setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, + &on, sizeof(on)) == -1) { + dropbear_log(LOG_WARNING, "Couldn't set IPV6_V6ONLY"); + } + } +#endif + set_sock_priority(sock); if (bind(sock, res->ai_addr, res->ai_addrlen) < 0) { |