]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3826] addressed review comments master
authorRazvan Becheriu <razvan@isc.org>
Thu, 31 Jul 2025 13:45:25 +0000 (16:45 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 31 Jul 2025 14:22:37 +0000 (14:22 +0000)
ChangeLog
src/hooks/dhcp/lease_cmds/lease_cmds.cc
src/hooks/dhcp/lease_cmds/libloadtests/lease_cmds4_unittest.cc

index e8834390b5bcf3fd5d326f8bd64a1108ac42f5c4..b8b249a42fa652533921d7ee53c7e08f92c35061 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2382.  [build]         razvan
+2382.  [func]          razvan
        Implemented the 'lease6-get-by-hw-address' command used to query
        IPv6 leases by HW Address.
        (Gitlab #3826)
index c0fc5a7869ddc32024199f2e9448dc2283a67bf8..423fe0c2da08ab21c92453db14c320790298f40e 100644 (file)
@@ -1597,7 +1597,7 @@ LeaseCmdsImpl::leaseGetByHwAddressHandler(CalloutHandle& handle) {
             isc_throw(BadValue, "'hw-address' parameter must be a string");
         }
 
-        if (!v4 && hw_address->stringValue().empty()) {
+        if (hw_address->stringValue().empty()) {
             isc_throw(BadValue, "'hw-address' parameter must not be empty");
         }
 
index a970224bcb71ab34f63af142d29d59b4b96e7516..f0c324318b69c849bedcf2fe39bbc3e447560c68 100644 (file)
@@ -1767,6 +1767,17 @@ void Lease4CmdsTest::testLease4GetByHwAddressParams() {
     exp_rsp = "'hw-address' parameter must be a string";
     testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
 
+    // Empty HWAddr.
+    cmd =
+        "{\n"
+        "    \"command\": \"lease4-get-by-hw-address\",\n"
+        "    \"arguments\": {"
+        "        \"hw-address\": \"\"\n"
+        "    }\n"
+        "}";
+    exp_rsp = "'hw-address' parameter must not be empty";
+    testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
+
     // Simply bad value.
     cmd =
         "{\n"
@@ -1795,15 +1806,6 @@ void Lease4CmdsTest::testLease4GetByHwAddressFind0() {
     string exp_rsp = "0 IPv4 lease(s) found.";
     testCommand(cmd, CONTROL_RESULT_EMPTY, exp_rsp);
 
-    // Empty HWAddr.
-    cmd =
-        "{\n"
-        "    \"command\": \"lease4-get-by-hw-address\",\n"
-        "    \"arguments\": {"
-        "        \"hw-address\": \"\"\n"
-        "    }\n"
-        "}";
-    testCommand(cmd, CONTROL_RESULT_EMPTY, exp_rsp);
 }
 
 void Lease4CmdsTest::testLease4GetByHwAddressFind2() {