]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#605,!329] allow creation of subnet6 without id set
authorRazvan Becheriu <razvan@isc.org>
Tue, 21 May 2019 08:55:19 +0000 (11:55 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 23 May 2019 12:18:26 +0000 (15:18 +0300)
src/lib/dhcpsrv/parsers/dhcp_parsers.cc

index 57c03c3547a960f9bd5ecb0adcb8e6f05e7280cb..f29feee04ea5d4011f8e6253c1c955b82e9ddaf6 100644 (file)
@@ -1149,9 +1149,11 @@ void
 Subnet6ConfigParser::initSubnet(data::ConstElementPtr params,
                                 asiolink::IOAddress addr, uint8_t len) {
     // Subnet ID is optional. If it is not supplied the value of 0 is used,
-    // which means autogenerate. The value was inserted earlier by calling
-    // SimpleParser6::setAllDefaults.
-    SubnetID subnet_id = static_cast<SubnetID>(getInteger(params, "id"));
+    // which means autogenerate.
+    SubnetID subnet_id = 0;
+    if (params->contains("id")) {
+        subnet_id = static_cast<SubnetID>(getInteger(params, "id"));
+    }
 
     // We want to log whether rapid-commit is enabled, so we get this
     // before the actual subnet creation.