]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1226] Moved rollback and CS
authorFrancis Dupont <fdupont@isc.org>
Wed, 20 May 2020 12:58:23 +0000 (14:58 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 20 May 2020 12:58:23 +0000 (14:58 +0200)
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc

index 2755f1470795f70ab2879e2fde9a8fcf7b6b2160..569bfba4413c72011ce04e3d494d998f2753fa81 100644 (file)
@@ -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));
 }
 
index 185d5f7f90c4351f5a02be4ac4f4b512f70b1eb2..358c235905015c9b7ea7915c65d9d3785cdb4a25 100644 (file)
@@ -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));
 }