]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1550] addressed comments
authorRazvan Becheriu <razvan@isc.org>
Thu, 19 Nov 2020 15:32:07 +0000 (17:32 +0200)
committerRazvan Becheriu <razvan@isc.org>
Thu, 19 Nov 2020 15:32:07 +0000 (17:32 +0200)
src/bin/dhcp4/tests/dora_unittest.cc
src/bin/dhcp6/tests/sarr_unittest.cc
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine.h

index 230aa1d647426b8690811db3ae67feefe843b0a1..bd7e83a66ac713949e509a2bb430d580f90cc23c 100644 (file)
@@ -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
index 246bb710cdb85f1fa01e5179773bd1709379c98a..88caa689920cb1d9eaf2f8ea6ad091d8fdc655b4 100644 (file)
@@ -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
index e78d358632c54de0afe292089e858a91f5edd10c..b8a8508320f7fceb2ca995b80f6aab7d8d87dd7a 100644 (file)
@@ -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() ||
index 4a72f5cce1ed6df0092465780f395a46d30bf81f..b7f8cb975f54722c5c72bc79fbc82cde4b95284c 100644 (file)
@@ -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