From acd24151ceaa6d01655ae39470111adae3a4fba4 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 5 Feb 2007 23:51:03 +0000 Subject: This wont compile atm git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6507 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/dns.cpp b/src/dns.cpp index ac6097cd2..ea6b000a9 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -291,7 +291,6 @@ int DNS::PruneCache() void DNS::Rehash() { - insp_inaddr addr; ip6munge = false; if (this->GetFd() > -1) @@ -319,6 +318,19 @@ void DNS::Rehash() this->ip6munge = true; } + this->socketfamily = AF_INET; +#ifdef IPV6 + if (strchr(ServerInstance->Config->DNSServer,':')) + { + this->socketfamily = AF_INET6; + inet_pton(AF_INET6, &this->myserver6, ServerInstance->Config->DNSServer); + } + else + inet_aton(&this->myserver4, ServerInstance->Config->DNSServer); +#else + inet_aton(&this->myserver4, ServerInstance->Config->DNSServer); +#endif + /* Initialize mastersocket */ int s = OpenTCPSocket(ServerInstance->Config->DNSServer, SOCK_DGRAM); this->SetFd(s); -- cgit v1.2.3