Skip to content
Snippets Groups Projects
Commit c1fe2ec5 authored by Matt Johnston's avatar Matt Johnston
Browse files

Try bind IPV6_V6ONLY

--HG--
extra : convert_revision : cfe965c1503984cafaa98b684269db99bec310eb
parent 81cacd9f
Branches
Tags
No related merge requests found
......@@ -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) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment