]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2725] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Thu, 29 Jun 2023 17:09:35 +0000 (20:09 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 29 Jun 2023 17:54:14 +0000 (20:54 +0300)
src/hooks/dhcp/lease_cmds/lease_parser.cc
src/hooks/dhcp/lease_cmds/tests/lease_cmds6_unittest.cc
src/lib/dhcpsrv/parsers/host_reservation_parser.cc

index 2ba0c397850281153639281dc4da6929d08d5475..7eb4119fd8e4260e7ba68d87032a6da728344aef 100644 (file)
@@ -394,8 +394,8 @@ Lease6Parser::parse(ConstSrvConfigPtr& cfg,
     if (prefix_len != 128) {
         IOAddress first_address = firstAddrInPrefix(addr, prefix_len);
         if (first_address != addr) {
-            isc_throw(BadValue, "Invalid Pool6 address boundaries: " << addr
-                      << " is not the first address in prefix: " << first_address
+            isc_throw(BadValue, "Prefix address: " << addr
+                      << " exceeds prefix/prefix-len pair: " << first_address
                       << "/" << static_cast<uint32_t>(prefix_len));
         }
     }
index 3fa9a5b635d38eaa197f25185e3c21c1825b4ae6..9b95b5e08d271598db5b9d1c374a87e954d08d14 100644 (file)
@@ -712,7 +712,7 @@ void Lease6CmdsTest::testLease6AddBadParams() {
         "        \"iaid\": 1234\n"
         "    }\n"
         "}";
-    exp_rsp = "Invalid Pool6 address boundaries: 2001:db8:1::1 is not the first address in prefix: 2001:db8:1::/48";
+    exp_rsp = "Prefix address: 2001:db8:1::1 exceeds prefix/prefix-len pair: 2001:db8:1::/48";
     testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
 }
 
@@ -2215,7 +2215,7 @@ void Lease6CmdsTest::testLease6UpdateBadParams() {
         "        \"iaid\": 1234\n"
         "    }\n"
         "}";
-    exp_rsp = "Invalid Pool6 address boundaries: 2001:db8:1::1 is not the first address in prefix: 2001:db8:1::/48";
+    exp_rsp = "Prefix address: 2001:db8:1::1 exceeds prefix/prefix-len pair: 2001:db8:1::/48";
     testCommand(txt, CONTROL_RESULT_ERROR, exp_rsp);
 }
 
@@ -3240,7 +3240,7 @@ void Lease6CmdsTest::testLease6BulkApplyAddsOnlyBadParam() {
         "        ]"
         "    }"
         "}";
-    exp_rsp = "Invalid Pool6 address boundaries: 2001:db8:1::123 is not the first address in prefix: 2001:db8:1::/48";
+    exp_rsp = "Prefix address: 2001:db8:1::123 exceeds prefix/prefix-len pair: 2001:db8:1::/48";
     testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
 
     // Check that the lease was not inserted.
@@ -3340,7 +3340,7 @@ void Lease6CmdsTest::testLease6BulkApplyUpdatesOnlyBadParam() {
         "        ]"
         "    }"
         "}";
-    exp_rsp = "Invalid Pool6 address boundaries: 2001:db8:1234:ab:: is not the first address in prefix: 2001:db8:1234::/56";
+    exp_rsp = "Prefix address: 2001:db8:1234:ab:: exceeds prefix/prefix-len pair: 2001:db8:1234::/56";
     testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
 
     // Check that the lease we inserted is stored.
index ab6f5fc8b26a7e3bbb10793cb6f7fff5ed9bcf00..2be464397155a9c873504fc53e88984f5dc652f9 100644 (file)
@@ -324,8 +324,8 @@ HostReservationParser6::parseInternal(const SubnetID& subnet_id,
                             IOAddress addr(prefix);
                             IOAddress first_address = firstAddrInPrefix(addr, prefix_len);
                             if (first_address != addr) {
-                                isc_throw(BadValue, "Invalid lease address boundaries: " << addr
-                                          << " is not the first address in prefix: " << first_address
+                                isc_throw(BadValue, "Prefix address: " << addr
+                                          << " exceeds prefix/prefix-len pair: " << first_address
                                           << "/" << static_cast<uint32_t>(prefix_len));
                             }
                         }