BIND 10 trac2544, updated. 16bdc3898aa70d2145872a5277f60711c32f2bd9 [2544] Subnet now inherits globally configured option value.

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Dec 18 09:24:13 UTC 2012


The branch, trac2544 has been updated
       via  16bdc3898aa70d2145872a5277f60711c32f2bd9 (commit)
      from  16cc994d2f3e15180fc022976062d616b0c05f38 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 16bdc3898aa70d2145872a5277f60711c32f2bd9
Author: Marcin Siodelski <marcin at isc.org>
Date:   Tue Dec 18 10:24:04 2012 +0100

    [2544] Subnet now inherits globally configured option value.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/dhcp4/config_parser.cc |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/config_parser.cc b/src/bin/dhcp4/config_parser.cc
index 792deb7..efa2b43 100644
--- a/src/bin/dhcp4/config_parser.cc
+++ b/src/bin/dhcp4/config_parser.cc
@@ -912,6 +912,27 @@ public:
             subnet->addOption(desc.option);
         }
 
+        // Check all global options and add them to the subnet object if
+        // they have been configured in the global scope. If they have been
+        // configured in the subnet scope we don't add global option because
+        // the one configured in the subnet scope always takes precedence.
+        BOOST_FOREACH(Subnet::OptionDescriptor desc, option_defaults) {
+            // Get all options specified locally in the subnet and having
+            // code equal to global option's code.
+            Subnet::OptionContainerTypeRange range = idx.equal_range(desc.option->getType());
+            // @todo: In the future we will be searching for options using either
+            // an option code or namespace. Currently we have only the option
+            // code available so if there is at least one option found with the
+            // specific code we don't add the globally configured option.
+            // @todo with this code the first globally configured option
+            // with the given code will be added to a subnet. We may
+            // want to issue a warning about dropping the configuration of
+            // a global option if one already exsists.
+            if (std::distance(range.first, range.second) == 0) {
+                subnet->addOption(desc.option);
+            }
+        }
+
         CfgMgr::instance().addSubnet4(subnet);
     }
 
@@ -966,6 +987,7 @@ private:
         factories["rebind-timer"] = Uint32Parser::Factory;
         factories["subnet"] = StringParser::Factory;
         factories["pool"] = PoolParser::Factory;
+        factories["option-data"] = OptionDataListParser::Factory;
 
         FactoryMap::iterator f = factories.find(config_id);
         if (f == factories.end()) {



More information about the bind10-changes mailing list