diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-28 23:20:30 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-10-28 23:20:30 +0000 |
commit | f9a0af279a418f6fa562545bca117533ff2e09ee (patch) | |
tree | 137953cd56983da9cd51860534b98ff5e7ee6a53 /src | |
parent | e79930ac02de36ec9b5bd3079955fc21b6f9b603 (diff) |
Fix 4in6 IP resolution hack now that the leading ::ffff: is stripped from the IP [danieldg]
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10745 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/users.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/users.cpp b/src/users.cpp index 4f0476911..848f2a1eb 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -101,11 +101,10 @@ void User::StartDNSLookup() const char* sip = this->GetIPString(); UserResolver *res_reverse; - /* Special case for 4in6 (Have i mentioned i HATE 4in6?) */ - if (!strncmp(sip, "0::ffff:", 8)) - res_reverse = new UserResolver(this->ServerInstance, this, sip + 8, DNS_QUERY_PTR4, cached); - else - res_reverse = new UserResolver(this->ServerInstance, this, sip, this->GetProtocolFamily() == AF_INET ? DNS_QUERY_PTR4 : DNS_QUERY_PTR6, cached); + QueryType resolvtype = strchr(sip, ':') ? DNS_QUERY_PTR6 : DNS_QUERY_PTR4; + // when GetProtocolFamily() works correctly with 4in6, this can be replaced by + // this->GetProtocolFamily() == AF_INET ? DNS_QUERY_PTR4 : DNS_QUERY_PTR6; + res_reverse = new UserResolver(this->ServerInstance, this, sip, resolvtype, cached); this->ServerInstance->AddResolver(res_reverse, cached); } |