summaryrefslogtreecommitdiff
path: root/src/networkPrefix.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2009-02-18 09:41:14 +0000
committerOthmar Gsenger <otti@anytun.org>2009-02-18 09:41:14 +0000
commit9571ef8dc50cd41880218f5bcb241c799f5822bb (patch)
tree8178abe40eadadb42b213a674a68efaf374a1f78 /src/networkPrefix.cpp
parentrebuild routing tree on addRoute (diff)
fixed routing table sorting for correct build of routing tree
Diffstat (limited to 'src/networkPrefix.cpp')
-rw-r--r--src/networkPrefix.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/networkPrefix.cpp b/src/networkPrefix.cpp
index 3efdcdd..045b251 100644
--- a/src/networkPrefix.cpp
+++ b/src/networkPrefix.cpp
@@ -62,9 +62,8 @@ bool NetworkPrefix::operator<(const NetworkPrefix &right) const
{
if (network_address_type_!=right.network_address_type_)
return false;
- if (NetworkAddress::operator<(static_cast<NetworkAddress>(right)))
- return true;
- static_cast<NetworkAddress>(right)<static_cast<NetworkAddress>(*this);
- return (right.length_<length_);
+ if (right.length_!=length_)
+ return (length_<right.length_);
+ return static_cast<NetworkAddress>(*this)<static_cast<NetworkAddress>(right);
}