]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1405] added more log warnings
authorRazvan Becheriu <razvan@isc.org>
Wed, 11 Nov 2020 17:28:24 +0000 (19:28 +0200)
committerRazvan Becheriu <razvan@isc.org>
Wed, 18 Nov 2020 13:55:23 +0000 (15:55 +0200)
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/parsers/dhcp_parsers.cc

index 9105d37e6ab73119d4d02af901897d47332a3469..d12f19788733be8b346113cffb70bf0c8f540df1 100644 (file)
@@ -916,6 +916,9 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
             continue;
         }
 
+        bool in_subnet = subnet->getReservationsInSubnet();
+        bool out_of_pool = subnet->getReservationsOutOfPool();
+
         /// @todo: We support only one hint for now
         Lease6Ptr lease =
             LeaseMgrFactory::instance().getLease6(ctx.currentIA().type_, hint);
@@ -926,8 +929,6 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
             // it has been reserved for us we would have already allocated a lease.
 
             ConstHostCollection hosts;
-            bool in_subnet = subnet->getReservationsInSubnet();
-            bool out_of_pool = subnet->getReservationsOutOfPool();
             // The out-of-pool flag indicates that no client should be assigned reservations
             // from within the dynamic pool, and for that reason we only look at reservations that
             // are outside the pools, hence the inPool check.
@@ -966,8 +967,6 @@ AllocEngine::allocateUnreservedLeases6(ClientContext6& ctx) {
 
             // If the lease is expired, we may likely reuse it, but...
             ConstHostCollection hosts;
-            bool in_subnet = subnet->getReservationsInSubnet();
-            bool out_of_pool = subnet->getReservationsOutOfPool();
             // The out-of-pool flag indicates that no client should be assigned reservations
             // from within the dynamic pool, and for that reason we only look at reservations that
             // are outside the pools, hence the inPool check.
index e3c903b93aee6f0e6ab58aaf7ccfbd947fd53bd7..0da6b4f84c6bf5f59aac64c2efc2debe18586829 100644 (file)
@@ -416,6 +416,9 @@ lease from the Cassandra database for the specified address.
 A debug message issued when the server is attempting to update IPv6
 lease from the Cassandra database for the specified address.
 
+% DHCPSRV_DEPRECATED_RESERVATION_MODE deprecated reservation-mode parameter; use reservations-global, reservations-in-subnet and reservations-out-of-pool instead.
+A warning message indicating that reservation-mode parameter is deprecated.
+
 % DHCPSRV_DHCP4O6_RECEIVED_BAD_PACKET received bad DHCPv4o6 packet: %1
 A bad DHCPv4o6 packet was received.
 
index 72b8a8dd4dc1830bf6fca1f934b51bdcaeb19d00..96976378b2e9a0e163fc75a2470cc642a9e4f8a8 100644 (file)
@@ -746,7 +746,9 @@ Subnet4ConfigParser::initSubnet(data::ConstElementPtr params,
     // Move from reservation mode to new reservations flags.
     ElementPtr mutable_params;
     mutable_params = boost::const_pointer_cast<Element>(params);
-    BaseNetworkParser::moveReservationMode(mutable_params);
+    if (BaseNetworkParser::moveReservationMode(mutable_params)) {
+        LOG_WARN(dhcpsrv_logger, DHCPSRV_DEPRECATED_RESERVATION_MODE);
+    }
 
     // Parse parameters common to all Network derivations.
     NetworkPtr network = boost::dynamic_pointer_cast<Network>(subnet4);
@@ -1242,7 +1244,9 @@ Subnet6ConfigParser::initSubnet(data::ConstElementPtr params,
     // Move from reservation mode to new reservations flags.
     ElementPtr mutable_params;
     mutable_params = boost::const_pointer_cast<Element>(params);
-    BaseNetworkParser::moveReservationMode(mutable_params);
+    if (BaseNetworkParser::moveReservationMode(mutable_params)) {
+        LOG_WARN(dhcpsrv_logger, DHCPSRV_DEPRECATED_RESERVATION_MODE);
+    }
 
     // Parse parameters common to all Network derivations.
     NetworkPtr network = boost::dynamic_pointer_cast<Network>(subnet_);