From: Razvan Becheriu Date: Wed, 22 May 2019 13:17:40 +0000 (+0300) Subject: [#605,!329] force subnet id in remote-subnet[4/6]-set X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d95537afaa05f6ce4ea1715fb2fced43db727993;p=thirdparty%2Fkea.git [#605,!329] force subnet id in remote-subnet[4/6]-set --- diff --git a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc index f29feee04e..a0c751ce89 100644 --- a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc +++ b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc @@ -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(getInteger(params, "id")); - } + SubnetID subnet_id = static_cast(getInteger(params, "id")); Subnet4Ptr subnet4(new Subnet4(addr, len, Triplet(), Triplet(), Triplet(), @@ -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(getInteger(params, "id")); - } + SubnetID subnet_id = static_cast(getInteger(params, "id")); // We want to log whether rapid-commit is enabled, so we get this // before the actual subnet creation.