]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1454] fix PDExclude fields in example JSONs
authorAndrei Pavel <andrei@isc.org>
Mon, 5 Oct 2020 14:39:33 +0000 (17:39 +0300)
committerAndrei Pavel <andrei@isc.org>
Fri, 16 Oct 2020 09:04:48 +0000 (12:04 +0300)
excluded prefix length should be higher in value (smaller in address space)

doc/examples/kea6/advanced.json
doc/examples/kea6/all-keys-netconf.json
doc/examples/kea6/all-keys.json
src/lib/dhcp/option6_pdexclude.cc
src/lib/dhcpsrv/pool.cc

index 1830f32d620d28a544958aa3256e96798e21d65d..7b543e1c074c133fca616a9a7a3096810ae80630 100644 (file)
             "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
index 4b4230de85fb93e7002027a81dfcaea4e1dea8a5..eb16357c2ee0e844347a1d3805a036c4225cdcde 100644 (file)
                                 "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": [],
index 324b4e7a8303c308f107c8b48a0a55d860f049f3..8bfab736ced5ca649c04366092993e5776b452f4 100644 (file)
                                 "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": [],
index 951b3f117feb1467be522fe3b3c5ed114e4e4cf4..977390220b49d8395a23d364a48ee017330526cf 100644 (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 << "/"
index 4cbd620042e5e47808ac41abae538bea4e961e79..518b79f0b3ef709a078d59a6a2e09b54f34269dc 100644 (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