* ---------------------------------------------------
*/
-/* $Core: libIRCDcidr */
+/* $Core */
#include "inspircd.h"
-#include "wildcard.h"
/* Used when comparing CIDR masks for the modulus bits left over.
* A lot of ircd's seem to do this:
* symbols, and recursively call MatchCIDR without
* username matching enabled to match the host part.
*/
- return (match(address.substr(0, username_addr_pos), cidr_mask.substr(0, username_mask_pos)) &&
+ return (InspIRCd::Match(address.substr(0, username_addr_pos), cidr_mask.substr(0, username_mask_pos), NULL) &&
MatchCIDR(address.substr(username_addr_pos + 1), cidr_mask.substr(username_mask_pos + 1), false));
}
else
cidr_copy = cidr_mask.substr(username_mask_pos + 1);
}
}
+ else
+ {
+ address_copy.assign(address);
+ cidr_copy.assign(cidr_mask);
+ }
in_addr address_in4;
in_addr mask_in4;
if (bits_chars != std::string::npos)
{
bits = atoi(cidr_copy.substr(bits_chars + 1).c_str());
+ cidr_copy.erase(bits_chars, cidr_copy.length() - bits_chars);
}
else
{