From 48e656682ae6b197f8fcb78b43e0fc5952864d52 Mon Sep 17 00:00:00 2001 From: Sebastian Schrader Date: Fri, 19 Oct 2018 17:17:09 +0200 Subject: [PATCH] [5184] Check shared-network setting consistency --- src/bin/dhcp4/json_config_parser.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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() + " "; -- 2.47.2