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:
+9
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user