]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/dns.cpp
Fix sqllog compile error
[user/henk/code/inspircd.git] / src / dns.cpp
index e4d0b73fb9c6307e67931c085c42d7bd176727d3..80909c0bb4b8ef5eee6e97d424275174e3d69624 100644 (file)
@@ -303,16 +303,17 @@ void DNS::Rehash()
                this->cache = new dnscache();
        }
 
-       irc::sockets::aptosa(ServerInstance->Config->DNSServer, DNS::QUERY_PORT, &myserver);
+       irc::sockets::aptosa(ServerInstance->Config->DNSServer, DNS::QUERY_PORT, myserver);
 
        /* Initialize mastersocket */
-       int s = irc::sockets::OpenTCPSocket(ServerInstance->Config->DNSServer, SOCK_DGRAM);
+       int s = socket(myserver.sa.sa_family, SOCK_DGRAM, 0);
        this->SetFd(s);
-       ServerInstance->SE->NonBlocking(this->GetFd());
 
        /* Have we got a socket and is it nonblocking? */
        if (this->GetFd() != -1)
        {
+               ServerInstance->SE->SetReuse(s);
+               ServerInstance->SE->NonBlocking(s);
                /* Bind the port - port 0 INADDR_ANY */
                if (!ServerInstance->BindSocket(this->GetFd(), portpass, "", false))
                {