summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2024-03-05 09:51:03 +0100
committerFrancis Dupont <fdupont@isc.org>2024-03-20 21:06:10 +0100
commitdd8ebba8d5f4f48299c137552131c0020ce5b58e (patch)
tree8299c360cb5b333d1820bafbcbd96d329bcbce86 /src
parent[#3212] restore code after rebase (diff)
downloadkea-dd8ebba8d5f4f48299c137552131c0020ce5b58e.tar.xz
kea-dd8ebba8d5f4f48299c137552131c0020ce5b58e.zip
[#2692] Checkpoint: code done, need UT
Diffstat (limited to 'src')
-rw-r--r--src/bin/dhcp4/ctrl_dhcp4_srv.cc10
-rw-r--r--src/bin/dhcp6/ctrl_dhcp6_srv.cc13
2 files changed, 22 insertions, 1 deletions
diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc
index 90dc449964..ed0278fa8b 100644
--- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc
+++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc
@@ -1077,6 +1077,7 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
} catch (const std::exception& ex) {
err << "Error initializing the lease allocators: "
<< ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
// Apply multi threading settings.
@@ -1091,6 +1092,15 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
+ /// Let postponed hook initializations to run.
+ try {
+ ControlledDhcpv4Srv::getInstance()->getIOService()->poll();
+ } catch (const std::exception& ex) {
+ err << "Error initializing hooks: "
+ << ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
+ }
+
return (answer);
}
diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc
index fe4200a682..cda7f8b87b 100644
--- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc
+++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc
@@ -1095,7 +1095,9 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
CfgMgr::instance().getStagingCfg()->getCfgSubnets6()->initAllocatorsAfterConfigure();
} catch (const std::exception& ex) {
- err << "Error initializing the lease allocators: " << ex.what();
+ err << "Error initializing the lease allocators: "
+ << ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
// Apply multi threading settings.
@@ -1110,6 +1112,15 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
+ /// Let postponed hook initializations to run.
+ try {
+ ControlledDhcpv6Srv::getInstance()->getIOService()->poll();
+ } catch (const std::exception& ex) {
+ err << "Error initializing hooks: "
+ << ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
+ }
+
return (answer);
}