mirror of
https://github.com/anope/anope.git
synced 2026-07-07 03:43:13 +02:00
Added an asynchronous DNS system and m_dnsbl, which checks clients against DNS blacklists.
Rewrote internal handling of IPs, we now properly support users using IPv6. Fixed a few problems with the UnrealIRCd protocol module.
This commit is contained in:
@@ -161,17 +161,3 @@ void b64_decode(const Anope::string &src, Anope::string &target)
|
||||
target.erase(target.length() - 1);
|
||||
}
|
||||
|
||||
int decode_ip(const Anope::string &buf)
|
||||
{
|
||||
int len = buf.length();
|
||||
Anope::string targ;
|
||||
|
||||
b64_decode(buf, targ);
|
||||
const struct in_addr ia = *reinterpret_cast<const struct in_addr *>(targ.c_str());
|
||||
if (len == 24) /* IPv6 */
|
||||
return 0;
|
||||
else if (len == 8) /* IPv4 */
|
||||
return ia.s_addr;
|
||||
else /* Error?? */
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user