]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3144] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Fri, 15 May 2026 07:41:38 +0000 (10:41 +0300)
committerRazvan Becheriu <razvan@isc.org>
Mon, 18 May 2026 11:22:02 +0000 (14:22 +0300)
ChangeLog
doc/sphinx/arm/ctrl-channel.rst
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/http_control_socket_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/http_control_socket_unittest.cc
src/share/api/interface-redetect.json

index d0d7d037e71b1ba28bd60fb406ed50a7d6deca95..81a71157f5a18f7fd7fb5b57fb13fd0d56693e4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2462.  [func]          razvan
+       Added 'interface-add', 'interface-list' and 'interface-redetect'
+       which can be used to add interfaces, list currently detected
+       interfaces and issue a re-detect procedure which updates the
+       interface configuration respectively. The re-detect procedure
+       only adds newly discovered interfaces, without removing any
+       previously detected interfaces.
+       (Gitlab #3144)
+
 Kea 3.1.8 (development) released on April 29, 2026
 
 2461.  [bug]           fdupont
index 00a3caeb95e2f455a99063419101d33e2d8d0517..03928567d05366b7373fdad2a0f99da4587e8c80 100644 (file)
@@ -500,7 +500,8 @@ The ``interface-redetect`` Command
 ----------------------------------
 
 The :isccmd:`interface-redetect` command retrieves the list of detected interfaces
-after performing a re-detect procedure.
+after performing a re-detect procedure which only adds newly discovered interfaces,
+without removing any previously detected interfaces.
 This command does not take any parameters."
 
 .. isccmd:: interface-add
index 6c9895563da4056499ee0f7e67cd64eeae58887b..e49094c4cacd49c6c0f39af137bbb3b5da7898e9 100644 (file)
@@ -1150,6 +1150,8 @@ disabled by setting the ``re-detect`` value to ``false``, for instance:
        ...
    }
 
+The re-detect mechanism usually removes previously detected interfaces and
+then adds all currently detected interfaces.
 Note that interfaces are not re-detected when the :isccmd:`config-test`
 or :isccmd:`config-set` commands are run.
 However, new interfaces are detected and are available for use by
index 0db8298001c61c6db8a6724f5802d6941dfee3b2..dea03cf992f9c421b92c7dcbfcc8655a000d0a58 100644 (file)
@@ -990,6 +990,8 @@ disabled by setting the ``re-detect`` value to ``false``, for instance:
        ...
    }
 
+The re-detect mechanism usually removes previously detected interfaces and
+then adds all currently detected interfaces.
 Note that interfaces are not re-detected when the :isccmd:`config-test`
 or :isccmd:`config-set` commands are run.
 However, new interfaces are detected and are available for use by
index f8d28460183050c4d42f1d9b59c173891ce78225..5ec8c0b1f463d7ed33289fbb5a1988a387e6fdfc 100644 (file)
@@ -762,7 +762,7 @@ ControlledDhcpv4Srv::commandInterfaceAddHandler(const std::string&,
         return (isc::config::createAnswer(CONTROL_RESULT_ERROR, message));
     }
     if (!ifaces_config->size()) {
-        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful."));
+        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Interface configuration successfully updated."));
     }
     bool error = false;
     try {
@@ -801,9 +801,9 @@ ControlledDhcpv4Srv::commandInterfaceAddHandler(const std::string&,
 
     ostringstream msg;
     if (!error) {
-        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful."));
+        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Interface configuration successfully updated."));
     } else {
-        msg << "Unexpected error while updating used interfaces: " << message;
+        msg << "Updating used interfaces failed: " << message;
         return (isc::config::createAnswer(CONTROL_RESULT_ERROR, msg.str()));
     }
 }
index 577f9dfb1dfed13cbdfddc80a1977bf4ef838a69..a72df2cdc80be2d2c511c664edf5b64fac15b65d 100644 (file)
@@ -2582,7 +2582,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, interfaceAdd) {
     std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendUnixCommand(command, response);
-    EXPECT_EQ(response, "{ \"result\": 0, \"text\": \"Configuration successful.\" }");
+    EXPECT_EQ(response, "{ \"result\": 0, \"text\": \"Interface configuration successfully updated.\" }");
 
     command = "{ \"command\": \"interface-list\" }";
     sendUnixCommand(command, response);
index 880f2ccc642319a63825a52698abc31791301e47..a5357fe36aa3240f60aacb849e606b244c1e6e63 100644 (file)
@@ -3807,7 +3807,7 @@ BaseCtrlChannelDhcpv4Test::testInterfaceAdd() {
     std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendHttpCommand(command, response);
-    EXPECT_EQ(response, "[ { \"result\": 0, \"text\": \"Configuration successful.\" } ]");
+    EXPECT_EQ(response, "[ { \"result\": 0, \"text\": \"Interface configuration successfully updated.\" } ]");
 
     command = "{ \"command\": \"interface-list\" }";
     sendHttpCommand(command, response);
index 74af883564f100d7a0fbe14a3ad6fff6d1982356..3c3041f73c67a920a4fe6a97ac94505055d289dc 100644 (file)
@@ -765,7 +765,7 @@ ControlledDhcpv6Srv::commandInterfaceAddHandler(const std::string&,
         return (isc::config::createAnswer(CONTROL_RESULT_ERROR, message));
     }
     if (!ifaces_config->size()) {
-        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful."));
+        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Interface configuration successfully updated."));
     }
     bool error = false;
     try {
@@ -804,9 +804,9 @@ ControlledDhcpv6Srv::commandInterfaceAddHandler(const std::string&,
 
     ostringstream msg;
     if (!error) {
-        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful."));
+        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Interface configuration successfully updated."));
     } else {
-        msg << "Unexpected error while updating used interfaces: " << message;
+        msg << "Updating used interfaces failed: " << message;
         return (isc::config::createAnswer(CONTROL_RESULT_ERROR, msg.str()));
     }
 }
index fb19537bbb2d9037730dc64a1cf1e7fbc7285127..fa952c17ae6a4155129fa5159db24825a1400c41 100644 (file)
@@ -2576,7 +2576,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, interfaceAdd) {
     std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendUnixCommand(command, response);
-    EXPECT_EQ(response, "{ \"result\": 0, \"text\": \"Configuration successful.\" }");
+    EXPECT_EQ(response, "{ \"result\": 0, \"text\": \"Interface configuration successfully updated.\" }");
 
     command = "{ \"command\": \"interface-list\" }";
     sendUnixCommand(command, response);
index f532cae51c40d51669618c6f55061b9205e55a09..f6bababc825e6daf72e6ff16afad69fed49667e4 100644 (file)
@@ -3799,7 +3799,7 @@ BaseCtrlChannelDhcpv6Test::testInterfaceAdd() {
     std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendHttpCommand(command, response);
-    EXPECT_EQ(response, "[ { \"result\": 0, \"text\": \"Configuration successful.\" } ]");
+    EXPECT_EQ(response, "[ { \"result\": 0, \"text\": \"Interface configuration successfully updated.\" } ]");
 
     command = "{ \"command\": \"interface-list\" }";
     sendHttpCommand(command, response);
index d08a0c744f485d46ff69ba094ac3b1ce870bca67..e61c64f1bf133e616d9b589efd23dbe61e5d9623 100644 (file)
@@ -3,7 +3,8 @@
     "avail": "3.1.9",
     "brief": [
         "This command retrieves the list of detected interfaces after performing",
-        "a re-detect procedure.",
+        "a re-detect procedure which only adds newly discovered interfaces,",
+        "without removing any previously detected interfaces.",
         "This command does not take any parameters."
     ],
     "cmd-syntax": [