]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#95] addressed review
authorRazvan Becheriu <razvan@isc.org>
Thu, 17 Feb 2022 18:45:38 +0000 (20:45 +0200)
committerRazvan Becheriu <razvan@isc.org>
Thu, 17 Feb 2022 19:12:10 +0000 (19:12 +0000)
src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc
src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.cc
src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc
src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.h

index 81d975bd38ab8c348267b102dbe35c7c2656c38a..07d2875f7fff39684a0861c6886fb69a7127432e 100644 (file)
@@ -1945,7 +1945,6 @@ public:
         createUpdateOption4(server_selector, pool_id, option, false);
     }
 
-
     /// @brief Sends query to insert or update DHCP option in a pool.
     ///
     /// @param selector Server selector.
index f0b8704c602183acdf75e15907fae3d86e7b7613..24b71dcc096167868f1f872da7fe22caed7d5f1f 100644 (file)
@@ -654,16 +654,12 @@ PgSqlConfigBackendImpl::getOption(const int index,
                                   " (unassigned) is unsupported at the moment");
     }
 
-    Option::Universe universe;
     std::string msg = "fetching ";
     if (pool_type == Lease::TYPE_PD) {
-        universe = Option::V6;
         msg += "prefix delegation";
     } else {
-        universe = Option::V4;
         msg += "address";
     }
-
     msg += " pool level option";
     auto tag = getServerTag(server_selector, msg);
 
@@ -672,8 +668,11 @@ PgSqlConfigBackendImpl::getOption(const int index,
     in_bindings.add(pool_id);
     in_bindings.add(code);   // Postgresql code is same size regardless of universe
     in_bindings.add(space);
-
+    Option::Universe universe = Option::V4;
     OptionContainer options;
+    if (pool_type != Lease::TYPE_V4) {
+        universe = Option::V6;
+    }
     getOptions(index, in_bindings, universe, options);
     return (options.empty() ? OptionDescriptorPtr() :
             OptionDescriptor::create(*options.begin()));
index d5778b84a5673614975663ba9e01f030e0fe1cec..78d380a96d3f2a32fdd8f893f725e14257a6b2d3 100644 (file)
@@ -518,9 +518,9 @@ GenericConfigBackendDHCPv4Test::testNewAuditEntry(const std::vector<ExpAuditEntr
         const auto& tags = server_selector.getTags();
         // This test is not meant to handle multiple server tags all at once.
         if (tags.size() != 1) {
-            ADD_FAILURE() << "Test error: tags.size(): " << tags.size() 
+            ADD_FAILURE() << "Test error: tags.size(): " << tags.size()
                           << ", you must specify one and only one server tag";
-        } 
+        }
 
         // Get the server tag for which we run the current test.
         tag = tags.begin()->get();
index 040158c96c9962ad94dd3ea1f2b29a9b4dba4542..b954eb818112a5f96c3acceba935f82ff8a059c2 100644 (file)
@@ -19,8 +19,10 @@ namespace test {
 struct ExpAuditEntry {
     /// @brief Type of object changed.
     std::string object_type;
+
     /// @brief Timestamp the change occurred.
     db::AuditEntry::ModificationType modification_type;
+
     /// @brief Log message describing the change.
     std::string log_message;
 };