From: Francis Dupont Date: Wed, 20 May 2020 12:58:23 +0000 (+0200) Subject: [#1226] Moved rollback and CS X-Git-Tag: Kea-1.7.8~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4e514c2724df1918e6b3e93f2e5ea326d6acea1;p=thirdparty%2Fkea.git [#1226] Moved rollback and CS --- diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 2755f14707..569bfba441 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -452,11 +452,6 @@ ControlledDhcpv4Srv::commandConfigTestHandler(const string&, return (result); } - // We are starting the configuration process so we should remove any - // staging configuration that has been created during previous - // configuration attempts. - CfgMgr::instance().rollback(); - // Check obsolete objects. // Relocate Logging. Note this allows to check the loggers configuration. @@ -464,6 +459,14 @@ ControlledDhcpv4Srv::commandConfigTestHandler(const string&, // Log obsolete objects and return an error. + // stop thread pool (if running) + MultiThreadingCriticalSection cs; + + // We are starting the configuration process so we should remove any + // staging configuration that has been created during previous + // configuration attempts. + CfgMgr::instance().rollback(); + // Now we check the server proper. return (checkConfig(dhcp4)); } @@ -926,9 +929,6 @@ ControlledDhcpv4Srv::checkConfig(isc::data::ConstElementPtr config) { return (isc::config::createAnswer(1, err.str())); } - // stop thread pool (if running) - MultiThreadingCriticalSection cs; - return (configureDhcp4Server(*srv, config, true)); } diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 185d5f7f90..358c235905 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -455,11 +455,6 @@ ControlledDhcpv6Srv::commandConfigTestHandler(const string&, return (result); } - // We are starting the configuration process so we should remove any - // staging configuration that has been created during previous - // configuration attempts. - CfgMgr::instance().rollback(); - // Check obsolete objects. // Relocate Logging. Note this allows to check the loggers configuration. @@ -467,6 +462,14 @@ ControlledDhcpv6Srv::commandConfigTestHandler(const string&, // Log obsolete objects and return an error. + // stop thread pool (if running) + MultiThreadingCriticalSection cs; + + // We are starting the configuration process so we should remove any + // staging configuration that has been created during previous + // configuration attempts. + CfgMgr::instance().rollback(); + // Now we check the server proper. return (checkConfig(dhcp6)); } @@ -945,9 +948,6 @@ ControlledDhcpv6Srv::checkConfig(isc::data::ConstElementPtr config) { return (no_srv); } - // stop thread pool (if running) - MultiThreadingCriticalSection cs; - return (configureDhcp6Server(*srv, config, true)); }