]> granicus.if.org Git - icinga2/commitdiff
Use AF_UNSPEC for Bind() calls.
authorGunnar Beutner <gunnar@beutner.name>
Sun, 1 Jun 2014 06:51:06 +0000 (08:51 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Sun, 1 Jun 2014 06:51:06 +0000 (08:51 +0200)
Fixes #6375

components/livestatus/livestatuslistener.cpp
lib/remote/apilistener.cpp

index f230fb349cf3de64c9725d2b5ad2a4cd67b9181b..857a2348944f920ecdce19320785c57c1b54bbb2 100644 (file)
@@ -70,7 +70,7 @@ void LivestatusListener::Start(void)
 
        if (GetSocketType() == "tcp") {
                TcpSocket::Ptr socket = make_shared<TcpSocket>();
-               socket->Bind(GetBindHost(), GetBindPort(), AF_INET);
+               socket->Bind(GetBindHost(), GetBindPort(), AF_UNSPEC);
 
                boost::thread thread(boost::bind(&LivestatusListener::ServerThreadProc, this, socket));
                thread.detach();
index 0e2ba7c80557789bdcd98a3a2ec48d3322c26e27..ff11fa9f893d8986106b651e6945845930c12b50 100644 (file)
@@ -136,7 +136,7 @@ void ApiListener::AddListener(const String& service)
        Log(LogInformation, "ApiListener", s.str());
 
        TcpSocket::Ptr server = make_shared<TcpSocket>();
-       server->Bind(service, AF_INET6);
+       server->Bind(service, AF_UNSPEC);
 
        boost::thread thread(boost::bind(&ApiListener::ListenerThreadProc, this, server));
        thread.detach();