From: Daniel De Graaf Date: Mon, 18 Apr 2011 20:58:35 +0000 (-0400) Subject: Fix mis-implemented irc::sockets::cidr_mask::operator< X-Git-Tag: v2.0.23~805 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=a07ad071563e924664cbf15e98557f9d4838062e;p=user%2Fhenk%2Fcode%2Finspircd.git Fix mis-implemented irc::sockets::cidr_mask::operator< --- diff --git a/src/socket.cpp b/src/socket.cpp index a04523ddf..22c320b24 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -338,8 +338,11 @@ bool irc::sockets::cidr_mask::operator==(const cidr_mask& other) const bool irc::sockets::cidr_mask::operator<(const cidr_mask& other) const { - return type < other.type || length < other.length || - memcmp(bits, other.bits, 16) < 0; + if (type != other.type) + return type < other.type; + if (length != other.length) + return length < other.length; + return memcmp(bits, other.bits, 16) < 0; } bool irc::sockets::cidr_mask::match(const irc::sockets::sockaddrs& addr) const