mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[#2725] addressed review comments
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
@@ -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.
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user