]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#605,!329] force subnet id in remote-subnet[4/6]-set
authorRazvan Becheriu <razvan@isc.org>
Wed, 22 May 2019 13:17:40 +0000 (16:17 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 23 May 2019 12:22:24 +0000 (15:22 +0300)
src/lib/dhcpsrv/parsers/dhcp_parsers.cc

index f29feee04ea5d4011f8e6253c1c955b82e9ddaf6..a0c751ce89a1ee23af59155143d0f11418744d37 100644 (file)
@@ -714,10 +714,7 @@ Subnet4ConfigParser::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.
-    SubnetID subnet_id = 0;
-    if (params->contains("id")) {
-        subnet_id = static_cast<SubnetID>(getInteger(params, "id"));
-    }
+    SubnetID subnet_id = static_cast<SubnetID>(getInteger(params, "id"));
 
     Subnet4Ptr subnet4(new Subnet4(addr, len, Triplet<uint32_t>(),
                                    Triplet<uint32_t>(), Triplet<uint32_t>(),
@@ -1150,10 +1147,7 @@ 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.
-    SubnetID subnet_id = 0;
-    if (params->contains("id")) {
-        subnet_id = static_cast<SubnetID>(getInteger(params, "id"));
-    }
+    SubnetID 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.