]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2780] Fixed merge issues
authorMarcin Siodelski <msiodelski@gmail.com>
Wed, 29 Mar 2023 19:24:44 +0000 (21:24 +0200)
committerMarcin Siodelski <msiodelski@gmail.com>
Wed, 29 Mar 2023 19:28:52 +0000 (21:28 +0200)
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/lib/dhcpsrv/dhcpsrv_messages.cc
src/lib/dhcpsrv/dhcpsrv_messages.h

index ffdb4250a50165b55d96325532516b54c8523602..8dfac250d98d310de7a04f037958414216ae310f 100644 (file)
@@ -1036,6 +1036,18 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
         return (notify_libraries);
     }
 
+
+    // Initialize the allocators. If the user selected a Free Lease Queue Allocator
+    // for any of the subnets, the server will now populate free leases to the queue.
+    // It may take a while!
+    try {
+        CfgMgr::instance().getStagingCfg()->getCfgSubnets4()->initAllocatorsAfterConfigure();
+
+    } catch (const std::exception& ex) {
+        err << "Error initializing the lease allocators: "
+            << ex.what();
+    }
+
     // Apply multi threading settings.
     // @note These settings are applied/updated only if no errors occur while
     // applying the new configuration.
@@ -1082,28 +1094,6 @@ ControlledDhcpv4Srv::finishConfigHookLibraries(isc::data::ConstElementPtr config
         }
     }
 
-    // Initialize the allocators. If the user selected a Free Lease Queue Allocator
-    // for any of the subnets, the server will now populate free leases to the queue.
-    // It may take a while!
-    try {
-        CfgMgr::instance().getStagingCfg()->getCfgSubnets4()->initAllocatorsAfterConfigure();
-
-    } catch (const std::exception& ex) {
-        err << "Error initializing the lease allocators: "
-            << ex.what();
-    }
-
-    // Apply multi threading settings.
-    // @note These settings are applied/updated only if no errors occur while
-    // applying the new configuration.
-    // @todo This should be fixed.
-    try {
-        CfgMultiThreading::apply(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading());
-    } catch (const std::exception& ex) {
-        err << "Error applying multi threading settings: "
-            << ex.what();
-        return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
-    }
     return (ConstElementPtr());
 }
 
index 847671db1396f703bfaf9db96e5ee32b2fdded67..3dfb9b4cb502bc88c879cb110ad44c1707b51ca2 100644 (file)
@@ -1055,6 +1055,16 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
         return (notify_libraries);
     }
 
+    // Initialize the allocators. If the user selected a Free Lease Queue Allocator
+    // for any of the subnets, the server will now populate free leases to the queue.
+    // It may take a while!
+    try {
+        CfgMgr::instance().getStagingCfg()->getCfgSubnets6()->initAllocatorsAfterConfigure();
+
+    } catch (const std::exception& ex) {
+        err << "Error initializing the lease allocators: " << ex.what();
+    }
+
     // Apply multi threading settings.
     // @note These settings are applied/updated only if no errors occur while
     // applying the new configuration.
@@ -1101,27 +1111,6 @@ ControlledDhcpv6Srv::finishConfigHookLibraries(isc::data::ConstElementPtr config
         }
     }
 
-    // Initialize the allocators. If the user selected a Free Lease Queue Allocator
-    // for any of the subnets, the server will now populate free leases to the queue.
-    // It may take a while!
-    try {
-        CfgMgr::instance().getStagingCfg()->getCfgSubnets6()->initAllocatorsAfterConfigure();
-
-    } catch (const std::exception& ex) {
-        err << "Error initializing the lease allocators: " << ex.what();
-    }
-
-    // Apply multi threading settings.
-    // @note These settings are applied/updated only if no errors occur while
-    // applying the new configuration.
-    // @todo This should be fixed.
-    try {
-        CfgMultiThreading::apply(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading());
-    } catch (const std::exception& ex) {
-        err << "Error applying multi threading settings: "
-            << ex.what();
-        return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
-    }
     return (ConstElementPtr());
 }
 
index 2d821c0b687212317ae239f4e5dded533f66b474..cd13ebc080f3c763b94dd03dc998907836649315 100644 (file)
@@ -20,6 +20,10 @@ extern const isc::log::MessageID DHCPSRV_CFGMGR_DDNS_PARAMETER_IGNORED = "DHCPSR
 extern const isc::log::MessageID DHCPSRV_CFGMGR_DDNS_PARAMETER_MOVED = "DHCPSRV_CFGMGR_DDNS_PARAMETER_MOVED";
 extern const isc::log::MessageID DHCPSRV_CFGMGR_DEL_SUBNET4 = "DHCPSRV_CFGMGR_DEL_SUBNET4";
 extern const isc::log::MessageID DHCPSRV_CFGMGR_DEL_SUBNET6 = "DHCPSRV_CFGMGR_DEL_SUBNET6";
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES = "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES";
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES_DONE = "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES_DONE";
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES = "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES";
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES_DONE = "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES_DONE";
 extern const isc::log::MessageID DHCPSRV_CFGMGR_IPV4_RESERVATIONS_NON_UNIQUE_IGNORED = "DHCPSRV_CFGMGR_IPV4_RESERVATIONS_NON_UNIQUE_IGNORED";
 extern const isc::log::MessageID DHCPSRV_CFGMGR_IPV6_RESERVATIONS_NON_UNIQUE_IGNORED = "DHCPSRV_CFGMGR_IPV6_RESERVATIONS_NON_UNIQUE_IGNORED";
 extern const isc::log::MessageID DHCPSRV_CFGMGR_IP_RESERVATIONS_UNIQUE_DUPLICATES_POSSIBLE = "DHCPSRV_CFGMGR_IP_RESERVATIONS_UNIQUE_DUPLICATES_POSSIBLE";
@@ -276,6 +280,10 @@ const char* values[] = {
     "DHCPSRV_CFGMGR_DDNS_PARAMETER_MOVED", "dhcp-ddns:%1 is deprecated, moving it to global:%2",
     "DHCPSRV_CFGMGR_DEL_SUBNET4", "IPv4 subnet %1 removed",
     "DHCPSRV_CFGMGR_DEL_SUBNET6", "IPv6 subnet %1 removed",
+    "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES", "populating free address leases for the FLQ allocator in subnet %1; it can take a while!",
+    "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES_DONE", "populated %1 free address leases for the FLQ allocator in subnet %2 in %3",
+    "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES", "populating free prefix leases for the FLQ allocator in subnet %1; it can take a while!",
+    "DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES_DONE", "populated %1 free prefix leases for the FLQ allocator in subnet %2 completed in %3",
     "DHCPSRV_CFGMGR_IPV4_RESERVATIONS_NON_UNIQUE_IGNORED", "ignoring \"ip-reservations-unique\" setting because at least one of the host database backends does not support non-unique IP reservations in a subnet",
     "DHCPSRV_CFGMGR_IPV6_RESERVATIONS_NON_UNIQUE_IGNORED", "ignoring \"ip-reservations-unique\" setting because at least one of the host database backends does not support non unique IP reservations in a subnet",
     "DHCPSRV_CFGMGR_IP_RESERVATIONS_UNIQUE_DUPLICATES_POSSIBLE", "setting \"ip-reservations-unique\" from false to true poses a risk that some host backends may still contain multiple reservations for the same IP address",
index ad70ed43f4f498697085e0b1539fec5c1ee036d9..cfd2db8b58420191875596fe2e5303e21f77925f 100644 (file)
@@ -21,6 +21,10 @@ extern const isc::log::MessageID DHCPSRV_CFGMGR_DDNS_PARAMETER_IGNORED;
 extern const isc::log::MessageID DHCPSRV_CFGMGR_DDNS_PARAMETER_MOVED;
 extern const isc::log::MessageID DHCPSRV_CFGMGR_DEL_SUBNET4;
 extern const isc::log::MessageID DHCPSRV_CFGMGR_DEL_SUBNET6;
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES;
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_ADDRESS_LEASES_DONE;
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES;
+extern const isc::log::MessageID DHCPSRV_CFGMGR_FLQ_POPULATE_FREE_PREFIX_LEASES_DONE;
 extern const isc::log::MessageID DHCPSRV_CFGMGR_IPV4_RESERVATIONS_NON_UNIQUE_IGNORED;
 extern const isc::log::MessageID DHCPSRV_CFGMGR_IPV6_RESERVATIONS_NON_UNIQUE_IGNORED;
 extern const isc::log::MessageID DHCPSRV_CFGMGR_IP_RESERVATIONS_UNIQUE_DUPLICATES_POSSIBLE;