1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 02:23:12 +02:00

Make os_session akill ip ranges and not individual user's ips

This commit is contained in:
Adam
2013-09-19 13:35:52 -04:00
parent 5ce90ba7d1
commit b880240d72
3 changed files with 13 additions and 2 deletions
+9 -1
View File
@@ -91,6 +91,11 @@ Anope::string sockaddrs::addr() const
return "";
}
bool sockaddrs::ipv6() const
{
return sa.sa_family == AF_INET6;
}
bool sockaddrs::operator()() const
{
return valid();
@@ -218,7 +223,10 @@ cidr::cidr(const Anope::string &ip, unsigned char len)
Anope::string cidr::mask() const
{
return Anope::printf("%s/%d", this->cidr_ip.c_str(), this->cidr_len);
if ((this->addr.ipv6() && this->cidr_len == 128) || (!this->addr.ipv6() && this->cidr_len == 32))
return this->cidr_ip;
else
return Anope::printf("%s/%d", this->cidr_ip.c_str(), this->cidr_len);
}
bool cidr::match(const sockaddrs &other)