From: Sebastian Schrader Date: Fri, 19 Oct 2018 15:17:09 +0000 (+0200) Subject: [5184] Check shared-network setting consistency X-Git-Tag: 259-libyang-adapt-authoritative_base~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48e656682ae6b197f8fcb78b43e0fc5952864d52;p=thirdparty%2Fkea.git [5184] Check shared-network setting consistency --- diff --git a/src/bin/dhcp4/json_config_parser.cc b/src/bin/dhcp4/json_config_parser.cc index efa04ffd12..d81da588c8 100644 --- a/src/bin/dhcp4/json_config_parser.cc +++ b/src/bin/dhcp4/json_config_parser.cc @@ -191,6 +191,7 @@ public: // Let's check if all subnets have either the same interface // or don't have the interface specified at all. string iface = (*net)->getIface(); + bool authoritative = (*net)->getAuthoritative(); const Subnet4Collection* subnets = (*net)->getAllSubnets(); if (subnets) { @@ -212,6 +213,12 @@ public: << " or the shared-network itself used " << iface); } + if (authoritative != (*subnet)->getAuthoritative()) { + isc_throw(DhcpConfigError, "Subnet " << (*subnet)->toText() + << " has different authoritative setting " << (*subnet)->getAuthoritative() + << " than the shared-network itself: " << authoritative); + } + // Let's collect the subnets in case we later find out the // subnet doesn't have a mandatory name. txt += (*subnet)->toText() + " ";