From eb762512dca38bbc3c5750f4ef6e6b1c408d1593 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Tue, 21 May 2019 11:55:19 +0300 Subject: [PATCH] [#605,!329] allow creation of subnet6 without id set --- src/lib/dhcpsrv/parsers/dhcp_parsers.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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. -- 2.47.2