diff --git a/src/lib/asiolink/io_address.h b/src/lib/asiolink/io_address.h index 42f09d7a9f..f99ba365c2 100644 --- a/src/lib/asiolink/io_address.h +++ b/src/lib/asiolink/io_address.h @@ -188,51 +188,16 @@ public: /// /// \param other Address to compare against. /// - /// \return true if this address is smaller than the other address. - /// - /// It is useful for comparing which address is bigger. - /// Operations within one protocol family are obvious. - /// Comparisons between v4 and v6 will always return v4 - /// being smaller. This follows boost::boost::asio::ip implementation - bool lessThan(const IOAddress& other) const { - if (this->getFamily() == other.getFamily()) { - if (this->getFamily() == AF_INET6) { - return (this->asio_address_.to_v6() < other.asio_address_.to_v6()); - } else { - return (this->asio_address_.to_v4() < other.asio_address_.to_v4()); - } - } - return (this->getFamily() < other.getFamily()); - } - - /// \brief Checks if one address is smaller or equal than the other - /// - /// \param other Address to compare against. - /// - /// \return true if this address is smaller than the other address. - bool smallerEqual(const IOAddress& other) const { - if (equals(other)) { - return (true); - } - return (lessThan(other)); - } - - /// \brief Checks if one address is smaller than the other - /// - /// \param other Address to compare against. - /// - /// See \ref lessThan method for details. bool operator<(const IOAddress& other) const { - return (lessThan(other)); + return (asio_address_ < other.asio_address_); } /// \brief Checks if one address is smaller or equal than the other /// /// \param other Address to compare against. /// - /// See \ref smallerEqual method for details. bool operator<=(const IOAddress& other) const { - return (smallerEqual(other)); + return (asio_address_ <= other.asio_address_); } /// \brief Compare addresses for inequality diff --git a/src/lib/dhcpsrv/pool.cc b/src/lib/dhcpsrv/pool.cc index e672f437a9..4619b098ad 100644 --- a/src/lib/dhcpsrv/pool.cc +++ b/src/lib/dhcpsrv/pool.cc @@ -26,7 +26,7 @@ Pool::Pool(Lease::Type type, const isc::asiolink::IOAddress& first, } bool Pool::inRange(const isc::asiolink::IOAddress& addr) const { - return (first_.smallerEqual(addr) && addr.smallerEqual(last_)); + return (first_ <= addr && addr <= last_); } bool Pool::clientSupported(const ClientClasses& classes) const {