From: Razvan Becheriu Date: Tue, 21 May 2019 08:55:19 +0000 (+0300) Subject: [#605,!329] allow creation of subnet6 without id set X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb762512dca38bbc3c5750f4ef6e6b1c408d1593;p=thirdparty%2Fkea.git [#605,!329] allow creation of subnet6 without id set --- diff --git a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc index 57c03c3547..f29feee04e 100644 --- a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc +++ b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc @@ -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(getInteger(params, "id")); + // which means autogenerate. + SubnetID subnet_id = 0; + if (params->contains("id")) { + 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.