]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5184] Check shared-network setting consistency
authorSebastian Schrader <sebastian.schrader@tu-dresden.de>
Fri, 19 Oct 2018 15:17:09 +0000 (17:17 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 7 Nov 2018 16:17:45 +0000 (23:17 +0700)
src/bin/dhcp4/json_config_parser.cc

index efa04ffd1282e981ace2ae36a7dea4a30756ac7b..d81da588c866e15ada97ca1e6113796a65990310 100644 (file)
@@ -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() + " ";