diff options
author | Othmar Gsenger <otti@anytun.org> | 2009-02-18 09:41:14 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2009-02-18 09:41:14 +0000 |
commit | 9571ef8dc50cd41880218f5bcb241c799f5822bb (patch) | |
tree | 8178abe40eadadb42b213a674a68efaf374a1f78 /src/networkPrefix.cpp | |
parent | rebuild 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.cpp | 7 |
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); } |