2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#1454] fix PDExclude fields in example JSONs

excluded prefix length should be higher in value (smaller in address space)
This commit is contained in:
Andrei Pavel
2020-10-05 17:39:33 +03:00
parent f8cb0c6ffd
commit 19cb752ada
5 changed files with 8 additions and 7 deletions

View File

@@ -133,7 +133,7 @@
"prefix-len": 48,
"delegated-len": 64,
"excluded-prefix": "2001:db8:abcd:1234::",
"excluded-prefix-len": 62,
"excluded-prefix-len": 72,
// Another user-context for this PD pool. Again, you can put
// anything you want in there as long as it's valid JSON and

View File

@@ -596,7 +596,7 @@
"excluded-prefix": "2001:db8::",
// Excluded prefix (length) from client assignments.
"excluded-prefix-len": 48,
"excluded-prefix-len": 72,
// Prefix pool level list of DHCP options.
"option-data": [],

View File

@@ -737,7 +737,7 @@
"excluded-prefix": "2001:db8::",
// Excluded prefix (length) from client assignments.
"excluded-prefix-len": 48,
"excluded-prefix-len": 72,
// Prefix pool level list of DHCP options.
"option-data": [],

View File

@@ -44,7 +44,7 @@ Option6PDExclude::Option6PDExclude(const isc::asiolink::IOAddress& delegated_pre
<< static_cast<int>(excluded_prefix_length_));
}
// Excluded prefix must be longer than the delegated prefix.
// Excluded prefix must be longer than or equal to the delegated prefix.
if (excluded_prefix_length_ <= delegated_prefix_length) {
isc_throw(BadValue, "length of the excluded prefix "
<< excluded_prefix << "/"

View File

@@ -309,9 +309,10 @@ Pool6::init(const Lease::Type& type,
// excluded_prefix_len == 0 means there's no excluded prefix at all.
if (excluded_prefix_len && (excluded_prefix_len < delegated_len)) {
isc_throw(BadValue, "Excluded prefix (" << static_cast<int>(excluded_prefix_len)
<< ") must be longer than the delegated prefix length ("
<< static_cast<int>(delegated_len));
isc_throw(BadValue, "Excluded prefix ("
<< static_cast<int>(excluded_prefix_len)
<< ") must be longer than or equal to the delegated prefix length ("
<< static_cast<int>(delegated_len) << ")");
}
/// @todo: We should probably implement checks against weird addresses