From: Marcin Siodelski Date: Wed, 29 Mar 2023 19:24:44 +0000 (+0200) Subject: [#2780] Fixed merge issues X-Git-Tag: Kea-2.3.7~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e323154b65d8a3f8dae1435c7208335c31d31966;p=thirdparty%2Fkea.git [#2780] Fixed merge issues --- diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index ffdb4250a5..8dfac250d9 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -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()); } diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 847671db13..3dfb9b4cb5 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -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()); } diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.cc b/src/lib/dhcpsrv/dhcpsrv_messages.cc index 2d821c0b68..cd13ebc080 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.cc +++ b/src/lib/dhcpsrv/dhcpsrv_messages.cc @@ -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", diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.h b/src/lib/dhcpsrv/dhcpsrv_messages.h index ad70ed43f4..cfd2db8b58 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.h +++ b/src/lib/dhcpsrv/dhcpsrv_messages.h @@ -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;