]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5314] Suppress excluded_prefix when blank in Pool6::toElement()
authorThomas Markwalder <tmark@isc.org>
Thu, 3 Aug 2017 19:19:00 +0000 (15:19 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 3 Aug 2017 19:19:00 +0000 (15:19 -0400)
    Pool6::toElement() will only include excluded-prefix if it isn't
    blank.

src/lib/dhcpsrv/subnet.cc
src/lib/dhcpsrv/tests/cfg_subnets6_unittest.cc

index a5d1b08ae445c1a1e50fad92e6ed9e7e54131c83..a28c0a9cbf4441e0be5f96e1d3afe7981c787097 100644 (file)
@@ -657,6 +657,7 @@ Subnet6::toElement() const {
         uint8_t len = pdpool->getLength();
         pool_map->set("delegated-len",
                       Element::create(static_cast<int>(len)));
+
         // Set excluded prefix
         const Option6PDExcludePtr& xopt =
             pdpool->getPrefixExcludeOption();
@@ -668,11 +669,8 @@ Subnet6::toElement() const {
             uint8_t xlen = xopt->getExcludedPrefixLength();
             pool_map->set("excluded-prefix-len",
                           Element::create(static_cast<int>(xlen)));
-        } else {
-            pool_map->set("excluded-prefix",
-                          Element::create(std::string("::")));
-            pool_map->set("excluded-prefix-len", Element::create(0));
         }
+
         // Set user-context
         ConstElementPtr context = pdpool->getContext();
         if (!isNull(context)) {
index 5b75ebd245dfbc6e1a7b4d670a90b18e35bbc5be..7572201fe85cb17450744f99e2d39e4b4721e42e 100644 (file)
@@ -545,8 +545,6 @@ TEST(CfgSubnets6Test, unparsePdPool) {
         "            \"prefix\": \"2001:db8:2::\",\n"
         "            \"prefix-len\": 48,\n"
         "            \"delegated-len\": 64,\n"
-        "            \"excluded-prefix\": \"::\",\n"
-        "            \"excluded-prefix-len\": 0,\n"
         "            \"option-data\": [ ]\n"
         "        },{\n"
         "            \"prefix\": \"2001:db8:3::\",\n"