From: Sunil Kallukudige Sreedhar Mayya Date: Fri, 10 Aug 2018 20:00:44 +0000 (+0200) Subject: [optimize_query] fixed review comments X-Git-Tag: gitlab29-base~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fbfc0111e12119234b4b083ccb865d7c113bd60;p=thirdparty%2Fkea.git [optimize_query] fixed review comments --- diff --git a/AUTHORS b/AUTHORS index 0a56cee962..252bebe03e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -172,7 +172,7 @@ We have received the following contributions: - Sunil Mayya 2018-07: support for Authentication option in DHCPv6 2018-07: support storage of Authentication keys in host structure - 2018-07: Optimized query for host reservation from the backends + 2018-08: Optimized query for host reservation from the backends Kea uses log4cplus (http://sourceforge.net/projects/log4cplus/) for logging, Boost (http://www.boost.org/) library for almost everything, and can use Botan diff --git a/ChangeLog b/ChangeLog index 273bf4d33f..68cb70a7b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 1436. [func] MayyaSunil - Implemented new index for queries host reservations by DUID. - (Github #98, git c20b5248da1283e596e35ad057ae242f4d613965) + Implemented new queries for host reservations by DUID. + (Github #99, git c20b5248da1283e596e35ad057ae242f4d613965) 1435. [func] marcin Implemented ha-continue command in HA hooks library and diff --git a/src/lib/dhcpsrv/cql_lease_mgr.cc b/src/lib/dhcpsrv/cql_lease_mgr.cc index 6c04fd8adc..5b41e6d852 100644 --- a/src/lib/dhcpsrv/cql_lease_mgr.cc +++ b/src/lib/dhcpsrv/cql_lease_mgr.cc @@ -1023,7 +1023,7 @@ StatementMap CqlLease6Exchange::tagged_statements_ = { "SELECT " "address, valid_lifetime, expire, subnet_id, pref_lifetime, duid, iaid, " "lease_type, prefix_len, fqdn_fwd, fqdn_rev, hostname, hwaddr, hwtype, " - "hwaddr_source, state " + "hwaddr_source, state, user_context " "FROM lease6 " "WHERE duid = ? " "ALLOW FILTERING "}}, diff --git a/src/lib/dhcpsrv/lease_mgr.h b/src/lib/dhcpsrv/lease_mgr.h index e6b05b07c6..e5759973fd 100644 --- a/src/lib/dhcpsrv/lease_mgr.h +++ b/src/lib/dhcpsrv/lease_mgr.h @@ -458,7 +458,7 @@ public: /// @return Lease collection (may be empty if no IPv6 lease found). virtual Lease6Collection getLeases6() const = 0; - /// @brief Returns collection of lease for matching DUID + /// @brief Returns collection of leases for matching DUID /// /// @return Lease collection /// (may be empty if no IPv6 lease found for the DUID). diff --git a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc index f961943753..dcb4bafef4 100644 --- a/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc +++ b/src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc @@ -1641,8 +1641,8 @@ GenericLeaseMgrTest::testGetLeases6Duid() { 80, subnet_id)); Lease6Ptr lease2(new Lease6(Lease::TYPE_NA, addr2, duid2, iaid, 100, 200, 50, 80, subnet_id)); - Lease6Ptr lease3(new Lease6(Lease::TYPE_NA, addr3, duid3, iaid, 100, 200, 50, - 80, subnet_id)); + Lease6Ptr lease3(new Lease6(Lease::TYPE_PD, addr3, duid3, iaid, 100, 200, 50, + 80, subnet_id, HWAddrPtr(), 64)); EXPECT_TRUE(lmptr_->addLease(lease1)); EXPECT_TRUE(lmptr_->addLease(lease2));