summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel De Graaf <danieldg@inspircd.org>2011-04-18 16:58:35 -0400
committerDaniel De Graaf <danieldg@inspircd.org>2011-04-18 16:58:42 -0400
commita07ad071563e924664cbf15e98557f9d4838062e (patch)
treeadba425f8b617b2bcc17c10367a06a93047e55ec /src
parentb56565eac2d7207c88c53054cb1096519ec7fba9 (diff)
Fix mis-implemented irc::sockets::cidr_mask::operator<
Diffstat (limited to 'src')
-rw-r--r--src/socket.cpp7
1 files changed, 5 insertions, 2 deletions
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