Commit db7bce71 authored by Romain Bignon's avatar Romain Bignon

force disable of IPV6_V6ONLY

parent 4efa98d1
......@@ -86,7 +86,7 @@ DaemonForkServerPoll::DaemonForkServerPoll(Minbif* application, ConfigSection* c
struct addrinfo *addrinfo_bind, *res, hints;
string bind_addr = section->GetItem("bind")->String();
uint16_t port = (uint16_t)section->GetItem("port")->Integer();
unsigned int reuse_addr = 1;
unsigned int reuse_addr = 1, ipv6_only = 0;
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
......@@ -106,6 +106,8 @@ DaemonForkServerPoll::DaemonForkServerPoll(Minbif* application, ConfigSection* c
continue;
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &reuse_addr, sizeof reuse_addr);
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &ipv6_only, sizeof ipv6_only);
if(bind(sock, res->ai_addr, res->ai_addrlen) < 0 ||
listen(sock, 5) < 0)
{
......
Markdown is supported
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