e->reason = tag->getString("reason");
e->domain = tag->getString("domain");
- if (tag->getString("type") == "bitmask")
+ if (stdalgo::string::equalsci(tag->getString("type"), "bitmask"))
{
e->type = DNSBLConfEntry::A_BITMASK;
e->bitmask = tag->getUInt("bitmask", 0, 0, UINT_MAX);
if ((user->exempt) || !DNS)
return;
+ // Clients can't be in a DNSBL if they aren't connected via IPv4 or IPv6.
+ if (user->client_sa.family() != AF_INET && user->client_sa.family() != AF_INET6)
+ return;
+
if (user->MyClass)
{
if (!user->MyClass->config->getBool("usednsbl", true))
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "User has no connect class in OnSetUserIP");
std::string reversedip;
- if (user->client_sa.sa.sa_family == AF_INET)
+ if (user->client_sa.family() == AF_INET)
{
unsigned int a, b, c, d;
d = (unsigned int) (user->client_sa.in4.sin_addr.s_addr >> 24) & 0xFF;
reversedip = ConvToStr(d) + "." + ConvToStr(c) + "." + ConvToStr(b) + "." + ConvToStr(a);
}
- else if (user->client_sa.sa.sa_family == AF_INET6)
+ else if (user->client_sa.family() == AF_INET6)
{
const unsigned char* ip = user->client_sa.in6.sin6_addr.s6_addr;