]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[sedhcpv6] Fixed a static destruction order fiasco with Botan on Fedora
authorFrancis Dupont <fdupont@isc.org>
Thu, 4 Jun 2015 14:51:36 +0000 (16:51 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 4 Jun 2015 14:51:36 +0000 (16:51 +0200)
src/bin/dhcp6/main.cc
src/lib/dhcpsrv/cfgmgr.cc
src/lib/dhcpsrv/cfgmgr.h

index 902c3a65d3722db19fdb2c8bbdcdb76ff3ac856b..1cc3106770afa83f6c28fa5c3e8667d85264e9e0 100644 (file)
@@ -172,6 +172,10 @@ main(int argc, char* argv[]) {
 
         LOG_INFO(dhcp6_logger, DHCP6_SHUTDOWN);
 
+        // Avoid a static destruction order fiasco with secure DHCPv6
+        // and Botan crypto backend...
+        CfgMgr::instance().clear(false);
+
     } catch (const std::exception& ex) {
 
         // First, we print the error on stderr (that should always work)
@@ -183,6 +187,9 @@ main(int argc, char* argv[]) {
         // the logger subsystem)
         LOG_FATAL(dhcp6_logger, DHCP6_SERVER_FAILED).arg(ex.what());
         ret = EXIT_FAILURE;
+
+        // No finally in C++?
+        CfgMgr::instance().clear(false);
     }
 
     return (ret);
index 8d3147e6b87a38d9f58f2370e23b4342211de1b4..acdc278d06e1638dc1d0cf8ca3d052d21af054bc 100644 (file)
@@ -109,9 +109,11 @@ CfgMgr::ensureCurrentAllocated() {
 }
 
 void
-CfgMgr::clear() {
+CfgMgr::clear(bool reinit) {
     configs_.clear();
-    ensureCurrentAllocated();
+    if (reinit) {
+        ensureCurrentAllocated();
+    }
 }
 
 void
index 77d8fd996aef4bb7128b6592bb19d5f5a8eb7719..7d875fba7c1e41633af1896991fae06671ca945f 100644 (file)
@@ -192,10 +192,10 @@ public:
     ///
     /// This function removes all configurations, including current and
     /// staging configurations. It creates a new current configuration with
-    /// default settings.
+    /// default settings when @param reinit is true.
     ///
     /// This function is exception safe.
-    void clear();
+    void clear(bool reinit = true);
 
     /// @brief Commits the staging configuration.
     ///