From: Razvan Becheriu Date: Thu, 19 Nov 2020 15:32:07 +0000 (+0200) Subject: [#1550] addressed comments X-Git-Tag: Kea-1.9.2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36675410518cd40fbd1917a1e07c71036ae1f487;p=thirdparty%2Fkea.git [#1550] addressed comments --- diff --git a/src/bin/dhcp4/tests/dora_unittest.cc b/src/bin/dhcp4/tests/dora_unittest.cc index 230aa1d647..bd7e83a66a 100644 --- a/src/bin/dhcp4/tests/dora_unittest.cc +++ b/src/bin/dhcp4/tests/dora_unittest.cc @@ -122,18 +122,18 @@ namespace { /// - Configuration 12: /// - Simple configuration with a single subnet /// - One in-pool reservation for MAC address aa:bb:cc:dd:ee:ff -/// - The reservations-in-subnet set to true +/// - The reservations-in-subnet flag is set to true /// /// - Configuration 13: /// - Simple configuration with a single subnet as in #12 -/// - The reservations-in-subnet set to false for testing that the +/// - The reservations-in-subnet flag is set to false for testing that the /// reservations are ignored /// /// - Configuration 14: /// - Simple configuration with a single subnet /// - Two host reservations, one out of the pool, another one in pool -/// - The reservations-in-subnet and reservations-out-of-pool set to true -/// to test that only out of pool reservations are honored. +/// - The reservations-in-subnet and reservations-out-of-pool flags are set to +/// true to test that only out of pool reservations are honored. /// /// - Configuration 15: /// - Use for testing authoritative flag diff --git a/src/bin/dhcp6/tests/sarr_unittest.cc b/src/bin/dhcp6/tests/sarr_unittest.cc index 246bb710cd..88caa68992 100644 --- a/src/bin/dhcp6/tests/sarr_unittest.cc +++ b/src/bin/dhcp6/tests/sarr_unittest.cc @@ -57,8 +57,8 @@ namespace { /// - Configuration 4: /// - Simple configuration with a single subnet /// - Two host reservations, one out of the pool, another one in pool -/// - The reservations-in-subnet and reservations-out-of-pool set to true -/// to test that only out of pool reservations are honored. +/// - The reservations-in-subnet and reservations-out-of-pool flags are set to +/// true to test that only out of pool reservations are honored. /// const char* CONFIGS[] = { // Configuration 0 diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index e78d358632..b8a8508320 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -3050,7 +3050,7 @@ hasAddressReservation(AllocEngine::ClientContext4& ctx) { auto host = ctx.hosts_.find(SUBNET_ID_GLOBAL); // if we want global + other modes we would need to // return only if true, else continue - if (host != ctx.hosts_.end() && + if (host != ctx.hosts_.end() && host->second && !host->second->getIPv4Reservation().isV4Zero()) { return (true); } @@ -3065,7 +3065,7 @@ hasAddressReservation(AllocEngine::ClientContext4& ctx) { // reserved addresses from within the dynamic pool, and for that // reason look only for reservations that are outside the pools, // hence the inPool check. - if (host != ctx.hosts_.end()) { + if (host != ctx.hosts_.end() && && host->second) { auto reservation = host->second->getIPv4Reservation(); if (!reservation.isV4Zero() && (!subnet->getReservationsOutOfPool() || diff --git a/src/lib/dhcpsrv/alloc_engine.h b/src/lib/dhcpsrv/alloc_engine.h index 4a72f5cce1..b7f8cb975f 100644 --- a/src/lib/dhcpsrv/alloc_engine.h +++ b/src/lib/dhcpsrv/alloc_engine.h @@ -940,7 +940,7 @@ public: /// @brief Attempts to find appropriate host reservation. /// /// Attempts to find appropriate host reservation in HostMgr. If found, it - /// it is set in the @c ctx.hosts_. + /// is set in the @ref ctx.hosts_. /// /// @node When the out-of-pool flag is enabled, because the function is /// called only once per DHCP message, the reservations that are in-subnet @@ -1582,7 +1582,7 @@ public: /// @brief Attempts to find the host reservation for the client. /// /// This method attempts to find the host reservation for the client. If - /// found, it is set in the @c ctx.hosts_. + /// found, it is set in the @ref ctx.hosts_. /// /// @node When the out-of-pool flag is enabled, because the function is /// called only once per DHCP message, the reservations that are in-subnet