diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-05 23:51:03 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-02-05 23:51:03 +0000 |
commit | acd24151ceaa6d01655ae39470111adae3a4fba4 (patch) | |
tree | 82f12a6543ee424998b2a1b49dde346cad387322 /src | |
parent | 49369545e34e9d16d53c6c62eb8659a590af62ed (diff) |
This wont compile atm
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6507 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/dns.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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); |