]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4001] backport #3910 to v2_6
authorRazvan Becheriu <razvan@isc.org>
Wed, 9 Jul 2025 04:24:38 +0000 (07:24 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 10 Jul 2025 08:03:09 +0000 (08:03 +0000)
ChangeLog
src/bin/dhcp4/tests/classify_unittest.cc
src/bin/dhcp6/tests/classify_unittests.cc
src/lib/dhcpsrv/alloc_engine.cc

index edd243261ab47a0a80e4cd0c498badf400005935..872c3b9916c580684ff1965513ecaba4a8c37b3a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2368.  [bug]           razvan
+       Fix error handling when detecting a global reservation for the
+       client and global reservatons are explicitly disabled in the
+       configuration.
+       (Gitlab #4001)
+
 Kea 2.6.3 (stable) released on May 28, 2025
 
 2267.  [build]         andrei
index b8c06c9f841f05d3dc1643065d02933b9222fdb4..a6112e2a484c0770ff6c476392d8dbcc2f39cf0a 100644 (file)
@@ -112,7 +112,7 @@ namespace {
 ///   - 2 subnets: 10.0.0.0/24 guarded by first and 10.0.1.0/24
 ///   - 2 pools: 10.0.0.10-10.0.0.100 and 10.0.1.10-10.0.1.100
 ///   - 1 global reservation for HW address 'aa:bb:cc:dd:ee:ff'
-///     setting the first class
+///     with IP address outside the pool, setting the first class
 ///   - the following class defined: first
 ///
 /// - Configuration 9:
@@ -412,6 +412,7 @@ const char* CONFIGS[] = {
         "}],"
         "\"reservations\": [ {"
         "    \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
+        "    \"ip-address\": \"10.0.1.200\","
         "    \"client-classes\": [ \"first\" ] } ]"
     "}",
 
index 85b1ef7e920ac2a3013f92ec50f8f6ca9c946bf6..b5a9378837288b60964349ac0de9a05ca5efb0a9 100644 (file)
@@ -98,7 +98,8 @@ namespace {
 ///   - Used for the early global reservations lookup / select subnet.
 ///   - 2 subnets: 2001:db8:1::/48 (guarded) and 2001:db8:2::/48
 ///   - 2 pools: 2001:db8:1:1::/64 and 2001:db8:2:1::/64
-///   - 1 global reservation setting the first class
+///   - 1 global reservation with IP address outside the pool, setting
+///     the first class
 ///   - the following class defined: first
 ///
 /// - Configuration 7:
@@ -416,6 +417,7 @@ const char* CONFIGS[] = {
     "\"reservations\": ["
     "{"
     "    \"duid\": \"01:02:03:04\","
+    "    \"ip-addresses\": [ \"2001:db8:1:cafe::1\" ],"
     "    \"client-classes\": [ \"first\" ]"
     "}"
     "],"
index 1e600c7b7d271c9b201eb3908ba9f3ad05ba4cf3..d2b7513af51918755d261675a4840fdb12be5a56 100644 (file)
@@ -3466,7 +3466,7 @@ hasAddressReservation(AllocEngine::ClientContext4& ctx) {
         LOG_DEBUG(alloc_engine_logger, ALLOC_ENGINE_DBG_TRACE,
                   ALLOC_ENGINE_IGNORING_UNSUITABLE_GLOBAL_ADDRESS)
             .arg(ctx.query_->getLabel())
-            .arg(ctx.currentHost()->getIPv4Reservation().toText())
+            .arg(global_host_address.toText())
             .arg(AllocEngine::labelNetworkOrSubnet(ctx.subnet_));
     }