]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5315] Option data parser checks for runtime definitions in LibDHCP.
authorMarcin Siodelski <marcin@isc.org>
Wed, 26 Jul 2017 20:14:01 +0000 (22:14 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 15 Aug 2017 12:00:56 +0000 (14:00 +0200)
Previously, it checked for them in the staging configuration but this is
not going to work for control commands which bypass the staging
configuration step.

src/lib/dhcpsrv/parsers/option_data_parser.cc

index fa66a753c61317514d3d5af9f3c43e25bcb1e948..bce9da0094b5248814c98b5f9cdd1fa9d9903eeb 100644 (file)
@@ -180,9 +180,16 @@ OptionDataParser::findOptionDefinition(const std::string& option_space,
     }
 
     if (!def) {
-        // Check if this is an option specified by a user.
-        def = CfgMgr::instance().getStagingCfg()->getCfgOptionDef()
-            ->get(option_space, search_key);
+        // Check if this is an option specified by a user. We used to
+        // check that in the staging configuration, but when the configuration
+        // changes are caused by a command the staging configuration doesn't
+        // exist. What is always available is the container holding runtime
+        // option definitions in LibDHCP. It holds option definitions from
+        // the staging configuration in case of the full reconfiguration or
+        // the definitions from the current configuration in case there is
+        // no staging configuration (after configuration commit). In other
+        // words, runtime options are always the ones that we need here.
+        def = LibDHCP::getRuntimeOptionDef(option_space, search_key);
     }
 
     return (def);