X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcidr.cpp;h=d38056b0298195e46679637c9b51b2f05b0a8fb1;hb=2d732f4d;hp=fb4ab447bebc2626b2cdeeb4aa4d6341685e7026;hpb=6a869d0701bbfe3c7a5e370793adfda4b5b45c65;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cidr.cpp b/src/cidr.cpp index fb4ab447b..d38056b02 100644 --- a/src/cidr.cpp +++ b/src/cidr.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -14,7 +14,6 @@ /* $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: @@ -91,7 +90,7 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr * 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), ascii_case_insensitive_map) && MatchCIDR(address.substr(username_addr_pos + 1), cidr_mask.substr(username_mask_pos + 1), false)); } else @@ -122,7 +121,6 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr return false; } -#ifdef SUPPORT_IP6LINKS in6_addr address_in6; in6_addr mask_in6; @@ -144,9 +142,7 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr return false; } } - else -#endif - if (inet_pton(AF_INET, address_copy.c_str(), &address_in4) > 0) + else if (inet_pton(AF_INET, address_copy.c_str(), &address_in4) > 0) { if (inet_pton(AF_INET, cidr_copy.c_str(), &mask_in4) > 0) {