From f2bd0c0340497d87657bca22e0089dd3c8bddd51 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 4 Jun 2008 10:09:29 -0700 Subject: [PATCH] bug 206: allow comparing addresses of different types. --- src/node/address.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/node/address.cc b/src/node/address.cc index 1902324d9..365161e63 100644 --- a/src/node/address.cc +++ b/src/node/address.cc @@ -162,8 +162,14 @@ bool operator != (const Address &a, const Address &b) } bool operator < (const Address &a, const Address &b) { - // XXX: it is not clear to me how to order based on type. - // so, we do not compare the types here but we should. + if (a.m_type < b.m_type) + { + return true; + } + else if (a.m_type > b.m_type) + { + return false; + } if (a.m_len < b.m_len) { return true;