]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Fixed merge errors
authorFrancis Dupont <fdupont@isc.org>
Wed, 11 Apr 2018 15:18:59 +0000 (17:18 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 11 Apr 2018 15:18:59 +0000 (17:18 +0200)
src/lib/dhcpsrv/parsers/client_class_def_parser.cc
src/lib/dhcpsrv/parsers/shared_network_parser.cc
src/lib/dhcpsrv/shared_network.cc
src/lib/dhcpsrv/testutils/host_data_source_utils.cc

index f44efbec2a37c870e48f09cafc9cc32c84b13148..0394f26e4370e1014f5cf9b09c3f6067e054835b 100644 (file)
@@ -198,7 +198,8 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
     // Add the client class definition
     try {
         class_dictionary->addClass(name, match_expr, test, required, options,
-                                   defs, next_server, sname, filename);
+                                   defs, user_context, next_server, sname,
+                                   filename);
     } catch (const std::exception& ex) {
         isc_throw(DhcpConfigError, "Can't add class: " << ex.what()
                   << " (" << class_def_cfg->getPosition() << ")");
index 2b65776e64535754aacbed4d8ce88e57587cbf55..ad395683b211c3dd8ac202bd5b7da8b50dea9437 100644 (file)
@@ -73,6 +73,7 @@ SharedNetwork4Parser::parse(const data::ConstElementPtr& shared_network_data) {
         ConstElementPtr user_context = shared_network_data->get("user-context");
         if (user_context) {
             shared_network->setContext(user_context);
+        }
 
         if (shared_network_data->contains("require-client-classes")) {
             const std::vector<data::ElementPtr>& class_list =
@@ -132,6 +133,7 @@ SharedNetwork6Parser::parse(const data::ConstElementPtr& shared_network_data) {
         ConstElementPtr user_context = shared_network_data->get("user-context");
         if (user_context) {
             shared_network->setContext(user_context);
+        }
 
         if (shared_network_data->contains("require-client-classes")) {
             const std::vector<data::ElementPtr>& class_list =
index 00d757d31bf94ef58e57362db21ff45cbac972ac..695a9cf5ff21cd9bc7178936f49c5145ae63ff4e 100644 (file)
@@ -208,7 +208,7 @@ public:
     /// such subnet by inspecting "last allocation" timestamps. The one with most
     /// recent timestamp is selected.
     ///
-    /// The preferred subnet must also fulfil the condition of equal client classes
+    /// The preferred subnet must also fulfil the condition of equal client class
     /// with the @c selected_subnet.
     ///
     /// @param subnets Container holding subnets belonging to this shared
@@ -226,7 +226,7 @@ public:
 
         auto preferred_subnet = selected_subnet;
         for (auto s = subnets.begin(); s != subnets.end(); ++s) {
-            if (((*s)->getClientClasses() == selected_subnet->getClientClasses()) &&
+            if (((*s)->getClientClass() == selected_subnet->getClientClass()) &&
                 ((*s)->getLastAllocatedTime(lease_type) >
                  selected_subnet->getLastAllocatedTime(lease_type))) {
                 preferred_subnet = (*s);
index a13914bdeb23717eb51ba6576f11757d52e39e08..ad1f4f0e38bf239a01116c67ff0433f1026ee579 100644 (file)
@@ -56,7 +56,7 @@ HostDataSourceUtils::generateIdentifier(const bool new_identifier) {
 
 HostPtr
 HostDataSourceUtils::initializeHost4(const std::string& address,
-                                           const Host::IdentifierType& id) {
+                                     const Host::IdentifierType& id) {
     std::vector<uint8_t> ident;
     if (id == Host::IDENT_HWADDR) {
         ident = generateHWAddr();
@@ -80,9 +80,9 @@ HostDataSourceUtils::initializeHost4(const std::string& address,
 
 HostPtr
 HostDataSourceUtils::initializeHost6(std::string address,
-                                           Host::IdentifierType identifier,
-                                           bool prefix,
-                                           bool new_identifier) {
+                                     Host::IdentifierType identifier,
+                                     bool prefix,
+                                     bool new_identifier) {
     std::vector<uint8_t> ident;
     switch (identifier) {
     case Host::IDENT_HWADDR:
@@ -121,7 +121,7 @@ HostDataSourceUtils::initializeHost6(std::string address,
 
 bool
 HostDataSourceUtils::reservationExists(const IPv6Resrv& resrv,
-                                             const IPv6ResrvRange& range) {
+                                       const IPv6ResrvRange& range) {
     for (IPv6ResrvIterator it = range.first; it != range.second; ++it) {
         if (resrv == it->second) {
             return true;
@@ -132,8 +132,8 @@ HostDataSourceUtils::reservationExists(const IPv6Resrv& resrv,
 
 void
 HostDataSourceUtils::compareHwaddrs(const ConstHostPtr& host1,
-                                          const ConstHostPtr& host2,
-                                          bool expect_match) {
+                                    const ConstHostPtr& host2,
+                                    bool expect_match) {
     ASSERT_TRUE(host1);
     ASSERT_TRUE(host2);
 
@@ -168,8 +168,8 @@ HostDataSourceUtils::compareHwaddrs(const ConstHostPtr& host1,
 
 void
 HostDataSourceUtils::compareDuids(const ConstHostPtr& host1,
-                                        const ConstHostPtr& host2,
-                                        bool expect_match) {
+                                  const ConstHostPtr& host2,
+                                  bool expect_match) {
     ASSERT_TRUE(host1);
     ASSERT_TRUE(host2);
 
@@ -203,7 +203,7 @@ HostDataSourceUtils::compareDuids(const ConstHostPtr& host1,
 
 void
 HostDataSourceUtils::compareHosts(const ConstHostPtr& host1,
-                                        const ConstHostPtr& host2) {
+                                  const ConstHostPtr& host2) {
     // Let's compare HW addresses and expect match.
     compareHwaddrs(host1, host2, true);
 
@@ -251,7 +251,7 @@ HostDataSourceUtils::compareHosts(const ConstHostPtr& host1,
 
 void
 HostDataSourceUtils::compareReservations6(IPv6ResrvRange resrv1,
-                                                IPv6ResrvRange resrv2) {
+                                          IPv6ResrvRange resrv2) {
     // Compare number of reservations for both hosts
     if (std::distance(resrv1.first, resrv1.second) !=
         std::distance(resrv2.first, resrv2.second)) {
@@ -303,13 +303,13 @@ HostDataSourceUtils::compareReservations6(IPv6ResrvRange resrv1,
 
 void
 HostDataSourceUtils::compareClientClasses(const ClientClasses& classes1,
-                                                const ClientClasses& classes2) {
-    EXPECT_TRUE(std::equal(classes1.begin(), classes1.end(), classes2.begin()));
+                                          const ClientClasses& classes2) {
+    EXPECT_TRUE(std::equal(classes1.cbegin(), classes1.cend(), classes2.cbegin()));
 }
 
 void
 HostDataSourceUtils::compareOptions(const ConstCfgOptionPtr& cfg1,
-                                          const ConstCfgOptionPtr& cfg2) {
+                                    const ConstCfgOptionPtr& cfg2) {
     ASSERT_TRUE(cfg1);
     ASSERT_TRUE(cfg2);