]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4415] fixed indentation and typos
authorRazvan Becheriu <razvan@isc.org>
Tue, 16 Jun 2026 14:15:11 +0000 (17:15 +0300)
committerRazvan Becheriu <razvan@isc.org>
Wed, 1 Jul 2026 15:54:25 +0000 (18:54 +0300)
ChangeLog
src/bin/d2/tests/d2_http_command_unittest.cc
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/lib/process/d_controller.cc

index 2780b36f7a826ef684f3011ebe070f489afd38a5..15e5dd63c607af6d199f77b802a3edf90a0723f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
 2499.  [func]          razvan
-       Kea daemons now exit when a critical failure is detected when
+       Kea daemons now exit if a critical failure is detected when
        issuing "config-reload", "config-set" and "interface-add"
        commands. Changed database reconnect disabled and failed
        log messages from info to either ERROR or FATAL as
index ccd9278812f42a7be8d0b2649d17bc5882db5c26..f03f751899ac06e797192c3c47e8961fac5c927b 100644 (file)
@@ -2327,6 +2327,9 @@ TEST_F(HttpCtrlChannelD2Test, handleHttpToHttpsSwitch) {
     config_set_txt += d2_st.str();
     config_set_txt += "}} \n";
 
+    EXPECT_EQ(EXIT_SUCCESS, server_->getExitValue());
+    EXPECT_FALSE(d2Controller()->getProcess()->shouldShutdown());
+
     // Send the config-set command.
     string response;
     sendHttpCommand(config_set_txt, response);
@@ -2345,6 +2348,9 @@ TEST_F(HttpCtrlChannelD2Test, handleHttpToHttpsSwitch) {
     keys = d2_context->getKeys();
     ASSERT_TRUE(keys);
     EXPECT_EQ(1U, keys->size());
+
+    EXPECT_EQ(EXIT_FAILURE, server_->getExitValue());
+    EXPECT_TRUE(d2Controller()->getProcess()->shouldShutdown());
 }
 
 // Verify that the "config-set" command will exit with an error
@@ -2433,6 +2439,9 @@ TEST_F(HttpsCtrlChannelD2Test, handleHttpsToHttpSwitch) {
     config_set_txt += d2_cfg_txt;
     config_set_txt += "}} \n";
 
+    EXPECT_EQ(EXIT_SUCCESS, server_->getExitValue());
+    EXPECT_FALSE(d2Controller()->getProcess()->shouldShutdown());
+
     // Send the config-set command.
     string response;
     sendHttpCommand(config_set_txt, response);
@@ -2452,6 +2461,9 @@ TEST_F(HttpsCtrlChannelD2Test, handleHttpsToHttpSwitch) {
     keys = d2_context->getKeys();
     ASSERT_TRUE(keys);
     EXPECT_EQ(1U, keys->size());
+
+    EXPECT_EQ(EXIT_FAILURE, server_->getExitValue());
+    EXPECT_TRUE(d2Controller()->getProcess()->shouldShutdown());
 }
 
 } // end of anonymous namespace
index c23c5dd32fb0bf81bd3b2eed7a70cf800fea3464..2644461a892880d22ccd39118dbe14498de4fd14 100644 (file)
@@ -1853,7 +1853,7 @@ ControlledDhcpv4Srv::reclaimExpiredLeases(const size_t max_leases,
         } else {
             LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_RECLAIM_EXPIRED_LEASES_SKIPPED)
                 .arg(CfgMgr::instance().getCurrentCfg()->
-                 getCfgExpiration()->getReclaimTimerWaitTime());
+                     getCfgExpiration()->getReclaimTimerWaitTime());
         }
     } catch (const std::exception& ex) {
         LOG_ERROR(dhcp4_logger, DHCP4_RECLAIM_EXPIRED_LEASES_FAIL)
@@ -1896,19 +1896,19 @@ ControlledDhcpv4Srv::dbLostCallback(ReconnectCtlPtr db_reconnect_ctl) {
     if (!db_reconnect_ctl->retriesLeft() ||
         !db_reconnect_ctl->retryInterval()) {
         if (db_reconnect_ctl->exitOnFailure()) {
-           LOG_FATAL(dhcp4_logger, DHCP4_FATAL_DB_RECONNECT_DISABLED)
-               .arg(db_reconnect_ctl->retriesLeft())
-               .arg(db_reconnect_ctl->retryInterval())
-               .arg(db_reconnect_ctl->id())
-               .arg(db_reconnect_ctl->timerName());
+            LOG_FATAL(dhcp4_logger, DHCP4_FATAL_DB_RECONNECT_DISABLED)
+                .arg(db_reconnect_ctl->retriesLeft())
+                .arg(db_reconnect_ctl->retryInterval())
+                .arg(db_reconnect_ctl->id())
+                .arg(db_reconnect_ctl->timerName());
             shutdownServer(EXIT_FAILURE);
         } else {
-           LOG_ERROR(dhcp4_logger, DHCP4_DB_RECONNECT_DISABLED)
-               .arg(db_reconnect_ctl->retriesLeft())
-               .arg(db_reconnect_ctl->retryInterval())
-               .arg(db_reconnect_ctl->id())
-               .arg(db_reconnect_ctl->timerName());
-       }
+            LOG_ERROR(dhcp4_logger, DHCP4_DB_RECONNECT_DISABLED)
+                .arg(db_reconnect_ctl->retriesLeft())
+                .arg(db_reconnect_ctl->retryInterval())
+                .arg(db_reconnect_ctl->id())
+                .arg(db_reconnect_ctl->timerName());
+        }
         return (false);
     }
 
@@ -1947,16 +1947,16 @@ ControlledDhcpv4Srv::dbFailedCallback(ReconnectCtlPtr db_reconnect_ctl) {
     }
 
     if (db_reconnect_ctl->exitOnFailure()) {
-       LOG_FATAL(dhcp4_logger, DHCP4_FATAL_DB_RECONNECT_FAILED)
-           .arg(db_reconnect_ctl->maxRetries())
-           .arg(db_reconnect_ctl->id())
-           .arg(db_reconnect_ctl->timerName());
+        LOG_FATAL(dhcp4_logger, DHCP4_FATAL_DB_RECONNECT_FAILED)
+            .arg(db_reconnect_ctl->maxRetries())
+            .arg(db_reconnect_ctl->id())
+            .arg(db_reconnect_ctl->timerName());
         shutdownServer(EXIT_FAILURE);
     } else {
-       LOG_ERROR(dhcp4_logger, DHCP4_DB_RECONNECT_FAILED)
-           .arg(db_reconnect_ctl->maxRetries())
-           .arg(db_reconnect_ctl->id())
-           .arg(db_reconnect_ctl->timerName());
+        LOG_ERROR(dhcp4_logger, DHCP4_DB_RECONNECT_FAILED)
+            .arg(db_reconnect_ctl->maxRetries())
+            .arg(db_reconnect_ctl->id())
+            .arg(db_reconnect_ctl->timerName());
     }
 
     return (true);
index 359d8d9545eb823190a28e0959598541694389f4..11d5f91781fe98ae1fb81b44d997dae03c6f372c 100644 (file)
@@ -425,7 +425,7 @@ information.
 % DHCP4_FATAL_DB_RECONNECT_DISABLED database reconnect is disabled: retries left: %1, reconnect wait time: %2, manager ID: %3, timer: %4
 This is an error message indicating that connectivity to either the
 lease or host database or both was lost and that automatic reconnect is
-ot enabled. This causes the server to shut down as specified in the
+not enabled. This causes the server to shut down as specified in the
 configuration. Loss of connectivity is typically a network or database server
 issue.
 
index 3a6b9d93a61bac67ccf5133b7e7a1a9f098127e8..564ec4b7c647b4fbddc742a76481be04f5d172c3 100644 (file)
@@ -1744,6 +1744,7 @@ ControlledDhcpv6Srv::dbFailedCallback(ReconnectCtlPtr db_reconnect_ctl) {
             .arg(db_reconnect_ctl->id())
             .arg(db_reconnect_ctl->timerName());
     }
+
     return (true);
 }
 
index dd06c9659d31c9d37d3074fddbff52167aad6d08..d5cc3e268477260c8ef08bf83388aed930cdd57a 100644 (file)
@@ -684,6 +684,11 @@ DControllerBase::configSetHandler(const std::string&, ConstElementPtr args) {
         ConstElementPtr answer = updateConfig(module_config);
         int rcode = 0;
         parseAnswer(rcode, answer);
+
+        if (rcode == CONTROL_RESULT_FATAL_ERROR) {
+            setExitValue(EXIT_FAILURE);
+            shutdownProcess(ElementPtr());
+        }
         // In all cases the right logging configuration is in the context.
         process_->getCfgMgr()->getContext()->applyLoggingCfg();
         return (answer);