]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#847,!23-p] Addressed issues with creating/deleting pool options in CB.
authorMarcin Siodelski <marcin@isc.org>
Tue, 20 Aug 2019 16:15:22 +0000 (18:15 +0200)
committerMarcin Siodelski <marcin@isc.org>
Tue, 20 Aug 2019 16:16:17 +0000 (18:16 +0200)
src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc
src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.cc
src/hooks/dhcp/mysql_cb/mysql_query_macros_dhcp.h
src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_unittest.cc
src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp6_unittest.cc

index dc11af75c183e09c61bce4d953d2fb05d077f3e0..bec9a1ccf0395b613f4a62b241c866f741eea2a5 100644 (file)
@@ -72,6 +72,7 @@ public:
         GET_MODIFIED_SUBNETS4_UNASSIGNED,
         GET_SHARED_NETWORK_SUBNETS4,
         GET_POOL4_RANGE,
+        GET_POOL4_RANGE_ANY,
         GET_SHARED_NETWORK4_NAME_NO_TAG,
         GET_SHARED_NETWORK4_NAME_ANY,
         GET_SHARED_NETWORK4_NAME_UNASSIGNED,
@@ -818,16 +819,25 @@ public:
         PoolCollection pools;
         std::vector<uint64_t> pool_ids;
 
-        auto tags = server_selector.getTags();
-        for (auto tag : tags) {
-            MySqlBindingCollection in_bindings = {
-                MySqlBinding::createString(tag.get()),
-                MySqlBinding::createInteger<uint32_t>(pool_start_address.toUint32()),
-                MySqlBinding::createInteger<uint32_t>(pool_end_address.toUint32())
-            };
+        if (server_selector.amAny()) {
+                MySqlBindingCollection in_bindings = {
+                    MySqlBinding::createInteger<uint32_t>(pool_start_address.toUint32()),
+                    MySqlBinding::createInteger<uint32_t>(pool_end_address.toUint32())
+                };
+                getPools(GET_POOL4_RANGE_ANY, in_bindings, pools, pool_ids);
 
-            getPools(GET_POOL4_RANGE, in_bindings, pools, pool_ids);
-            // Break if something is found?
+        } else {
+            auto tags = server_selector.getTags();
+            for (auto tag : tags) {
+                MySqlBindingCollection in_bindings = {
+                    MySqlBinding::createString(tag.get()),
+                    MySqlBinding::createInteger<uint32_t>(pool_start_address.toUint32()),
+                    MySqlBinding::createInteger<uint32_t>(pool_end_address.toUint32())
+                };
+
+                getPools(GET_POOL4_RANGE, in_bindings, pools, pool_ids);
+                // Break if something is found?
+            }
         }
 
         if (!pools.empty()) {
@@ -2194,37 +2204,15 @@ TaggedStatementArray tagged_statements = { {
       MYSQL_GET_SUBNET4_ANY(WHERE s.shared_network_name = ?)
     },
 
-    // Select pool by address range.
+    // Select pool by address range for a server.
     { MySqlConfigBackendDHCPv4Impl::GET_POOL4_RANGE,
-      "SELECT"
-      "  p.id,"
-      "  p.start_address,"
-      "  p.end_address,"
-      "  p.subnet_id,"
-      "  p.client_class,"
-      "  p.require_client_classes,"
-      "  p.user_context,"
-      "  p.modification_ts,"
-      "  x.option_id,"
-      "  x.code,"
-      "  x.value,"
-      "  x.formatted_value,"
-      "  x.space,"
-      "  x.persistent,"
-      "  x.dhcp4_subnet_id,"
-      "  x.scope_id,"
-      "  x.user_context,"
-      "  x.shared_network_name,"
-      "  x.pool_id,"
-      "  x.modification_ts "
-      "FROM dhcp4_pool AS p "
-      "INNER JOIN dhcp4_subnet_server AS s ON p.subnet_id = s.subnet_id "
-      "INNER JOIN dhcp4_server AS srv "
-      " ON (s.server_id = srv.id) OR (s.server_id = 1) "
-      "LEFT JOIN dhcp4_options AS x ON x.scope_id = 5 AND p.id = x.pool_id "
-      "WHERE (srv.tag = ? OR srv.id = 1) "
-      " AND p.start_address = ? AND p.end_address = ? "
-      "ORDER BY p.id, x.option_id"
+      MYSQL_GET_POOL4_RANGE_WITH_TAG(WHERE (srv.tag = ? OR srv.id = 1) AND p.start_address = ? \
+                                     AND p.end_address = ?)
+    },
+
+    // Select pool by address range for any server
+    { MySqlConfigBackendDHCPv4Impl::GET_POOL4_RANGE_ANY,
+      MYSQL_GET_POOL4_RANGE_NO_TAG(WHERE p.start_address = ? AND p.end_address = ?)
     },
 
     // Select shared network by name.
index dcda8d9eda11723e51912ffbb65a71e9ea145a5e..14ffaf363c4474816843efad22644da7013b878e 100644 (file)
@@ -73,7 +73,9 @@ public:
         GET_MODIFIED_SUBNETS6_UNASSIGNED,
         GET_SHARED_NETWORK_SUBNETS6,
         GET_POOL6_RANGE,
+        GET_POOL6_RANGE_ANY,
         GET_PD_POOL,
+        GET_PD_POOL_ANY,
         GET_SHARED_NETWORK6_NAME_NO_TAG,
         GET_SHARED_NETWORK6_NAME_ANY,
         GET_SHARED_NETWORK6_NAME_UNASSIGNED,
@@ -1038,23 +1040,32 @@ public:
         PoolCollection pools;
         std::vector<uint64_t> pool_ids;
 
-        auto tags = server_selector.getTags();
-        for (auto tag : tags) {
+        if (server_selector.amAny()) {
             MySqlBindingCollection in_bindings = {
-                MySqlBinding::createString(tag.get()),
-                MySqlBinding::createString(pool_start_address.toText()),
-                MySqlBinding::createString(pool_end_address.toText())
+                    MySqlBinding::createString(pool_start_address.toText()),
+                    MySqlBinding::createString(pool_end_address.toText())
             };
+            getPools(GET_POOL6_RANGE_ANY, in_bindings, pools, pool_ids);
 
-            getPools(GET_POOL6_RANGE, in_bindings, pools, pool_ids);
+        } else {
+            auto tags = server_selector.getTags();
+            for (auto tag : tags) {
+                MySqlBindingCollection in_bindings = {
+                    MySqlBinding::createString(tag.get()),
+                    MySqlBinding::createString(pool_start_address.toText()),
+                    MySqlBinding::createString(pool_end_address.toText())
+                };
+                getPools(GET_POOL6_RANGE, in_bindings, pools, pool_ids);
 
-            // Return upon the first pool found.
-            if (!pools.empty()) {
-                pool_id = pool_ids[0];
-                return (boost::dynamic_pointer_cast<Pool6>(*pools.begin()));
             }
         }
 
+        // Return upon the first pool found.
+        if (!pools.empty()) {
+            pool_id = pool_ids[0];
+            return (boost::dynamic_pointer_cast<Pool6>(*pools.begin()));
+        }
+
         pool_id = 0;
         return (Pool6Ptr());
     }
@@ -1073,16 +1084,23 @@ public:
         PoolCollection pd_pools;
         std::vector<uint64_t> pd_pool_ids;
 
-        auto tags = server_selector.getTags();
-        for (auto tag : tags) {
+        if (server_selector.amAny()) {
             MySqlBindingCollection in_bindings = {
-                MySqlBinding::createString(tag.get()),
                 MySqlBinding::createString(pd_pool_prefix.toText()),
                 MySqlBinding::createInteger<uint8_t>(pd_pool_prefix_length)
             };
+            getPdPools(GET_PD_POOL_ANY, in_bindings, pd_pools, pd_pool_ids);
 
-            getPdPools(GET_PD_POOL, in_bindings, pd_pools, pd_pool_ids);
-            // Break if something is found?
+        } else {
+            auto tags = server_selector.getTags();
+            for (auto tag : tags) {
+                MySqlBindingCollection in_bindings = {
+                    MySqlBinding::createString(tag.get()),
+                    MySqlBinding::createString(pd_pool_prefix.toText()),
+                    MySqlBinding::createInteger<uint8_t>(pd_pool_prefix_length)
+                };
+                getPdPools(GET_PD_POOL, in_bindings, pd_pools, pd_pool_ids);
+            }
         }
 
         if (!pd_pools.empty()) {
@@ -1975,9 +1993,6 @@ public:
                       " (unassigned) is unsupported at the moment");
         }
 
-        auto tag = getServerTag(server_selector,
-                                "creating or updating subnet level option");
-
         MySqlBindingCollection in_bindings = {
             MySqlBinding::createInteger<uint16_t>(option->option_->getType()),
             createOptionValueBinding(option),
@@ -2635,75 +2650,26 @@ TaggedStatementArray tagged_statements = { {
       MYSQL_GET_SUBNET6_ANY(WHERE s.shared_network_name = ?)
     },
 
-    // Select pool by address range.
+    // Select pool by address range for a server.
     { MySqlConfigBackendDHCPv6Impl::GET_POOL6_RANGE,
-      "SELECT"
-      "  p.id,"
-      "  p.start_address,"
-      "  p.end_address,"
-      "  p.subnet_id,"
-      "  p.client_class,"
-      "  p.require_client_classes,"
-      "  p.user_context,"
-      "  p.modification_ts,"
-      "  x.option_id,"
-      "  x.code,"
-      "  x.value,"
-      "  x.formatted_value,"
-      "  x.space,"
-      "  x.persistent,"
-      "  x.dhcp6_subnet_id,"
-      "  x.scope_id,"
-      "  x.user_context,"
-      "  x.shared_network_name,"
-      "  x.pool_id,"
-      "  x.modification_ts,"
-      "  x.pd_pool_id "
-      "FROM dhcp6_pool AS p "
-      "INNER JOIN dhcp6_subnet_server AS s ON p.subnet_id = s.subnet_id "
-      "INNER JOIN dhcp6_server AS srv "
-      " ON (s.server_id = srv.id) OR (s.server_id = 1) "
-      "LEFT JOIN dhcp6_options AS x ON x.scope_id = 5 AND p.id = x.pool_id "
-      "WHERE (srv.tag = ? OR srv.id = 1) "
-      " AND p.start_address = ? AND p.end_address = ? "
-      "ORDER BY p.id, x.option_id"
-    },
-
-    // Select prefix delegation pool.
+      MYSQL_GET_POOL6_RANGE_WITH_TAG(WHERE (srv.tag = ? OR srv.id = 1) AND p.start_address = ? \
+                                     AND p.end_address = ?)
+    },
+
+    // Select pool by address range for any server.
+    { MySqlConfigBackendDHCPv6Impl::GET_POOL6_RANGE_ANY,
+      MYSQL_GET_POOL6_RANGE_NO_TAG(WHERE p.start_address = ? AND p.end_address = ?)
+    },
+
+    // Select prefix delegation pool for a server.
     { MySqlConfigBackendDHCPv6Impl::GET_PD_POOL,
-      "SELECT"
-      "  p.id,"
-      "  p.prefix,"
-      "  p.prefix_length,"
-      "  p.delegated_prefix_length,"
-      "  p.subnet_id,"
-      "  p.excluded_prefix,"
-      "  p.excluded_prefix_length,"
-      "  p.client_class,"
-      "  p.require_client_classes,"
-      "  p.user_context,"
-      "  p.modification_ts,"
-      "  x.option_id,"
-      "  x.code,"
-      "  x.value,"
-      "  x.formatted_value,"
-      "  x.space,"
-      "  x.persistent,"
-      "  x.dhcp6_subnet_id,"
-      "  x.scope_id,"
-      "  x.user_context,"
-      "  x.shared_network_name,"
-      "  x.pool_id,"
-      "  x.modification_ts,"
-      "  x.pd_pool_id "
-      "FROM dhcp6_pd_pool AS p "
-      "INNER JOIN dhcp6_subnet_server AS s ON p.subnet_id = s.subnet_id "
-      "INNER JOIN dhcp6_server AS srv "
-      " ON (s.server_id = srv.id) OR (s.server_id = 1) "
-      "LEFT JOIN dhcp6_options AS x ON x.scope_id = 6 AND p.id = x.pd_pool_id "
-      "WHERE (srv.tag = ? OR srv.id = 1) "
-      " AND p.prefix = ? AND p.prefix_length = ? "
-      "ORDER BY p.id, x.option_id"
+      MYSQL_GET_PD_POOL_WITH_TAG(WHERE (srv.tag = ? OR srv.id = 1) \
+                                 AND p.prefix = ? AND p.prefix_length = ?)
+    },
+
+    // Select prefix delegation pool for any server.
+    { MySqlConfigBackendDHCPv6Impl::GET_PD_POOL_ANY,
+      MYSQL_GET_PD_POOL_NO_TAG(WHERE p.prefix = ? AND p.prefix_length = ?)
     },
 
     // Select shared network by name.
index 6ae77e3c0e86f3faae456ca633baaf1a7d272183..47335610238bdc2ed37fe16404ea7a93bff6c2bd 100644 (file)
@@ -265,6 +265,131 @@ namespace {
 
 #endif
 
+#ifndef MYSQL_GET_POOL4_COMMON
+#define MYSQL_GET_POOL4_COMMON(server_join, ...) \
+      "SELECT" \
+      "  p.id," \
+      "  p.start_address," \
+      "  p.end_address," \
+      "  p.subnet_id," \
+      "  p.client_class," \
+      "  p.require_client_classes," \
+      "  p.user_context," \
+      "  p.modification_ts," \
+      "  x.option_id," \
+      "  x.code," \
+      "  x.value," \
+      "  x.formatted_value," \
+      "  x.space," \
+      "  x.persistent," \
+      "  x.dhcp4_subnet_id," \
+      "  x.scope_id," \
+      "  x.user_context," \
+      "  x.shared_network_name," \
+      "  x.pool_id," \
+      "  x.modification_ts " \
+      "FROM dhcp4_pool AS p " \
+      server_join \
+      "LEFT JOIN dhcp4_options AS x ON x.scope_id = 5 AND p.id = x.pool_id " \
+      #__VA_ARGS__ \
+      " ORDER BY p.id, x.option_id"
+
+#define MYSQL_GET_POOL4_RANGE_WITH_TAG(...) \
+    MYSQL_GET_POOL4_COMMON( \
+       "INNER JOIN dhcp4_subnet_server AS s ON p.subnet_id = s.subnet_id " \
+       "INNER JOIN dhcp4_server AS srv " \
+       " ON (s.server_id = srv.id) OR (s.server_id = 1) ", \
+       __VA_ARGS__)
+
+#define MYSQL_GET_POOL4_RANGE_NO_TAG(...) \
+    MYSQL_GET_POOL4_COMMON("", __VA_ARGS__)
+#endif
+
+#ifndef MYSQL_GET_POOL6_COMMON
+#define MYSQL_GET_POOL6_COMMON(server_join, ...) \
+    "SELECT" \
+    "  p.id," \
+    "  p.start_address," \
+    "  p.end_address," \
+    "  p.subnet_id," \
+    "  p.client_class," \
+    "  p.require_client_classes," \
+    "  p.user_context," \
+    "  p.modification_ts," \
+    "  x.option_id," \
+    "  x.code," \
+    "  x.value," \
+    "  x.formatted_value," \
+    "  x.space," \
+    "  x.persistent," \
+    "  x.dhcp6_subnet_id," \
+    "  x.scope_id," \
+    "  x.user_context," \
+    "  x.shared_network_name," \
+    "  x.pool_id," \
+    "  x.modification_ts," \
+    "  x.pd_pool_id " \
+    "FROM dhcp6_pool AS p " \
+    server_join \
+    "LEFT JOIN dhcp6_options AS x ON x.scope_id = 5 AND p.id = x.pool_id " \
+    #__VA_ARGS__ \
+    " ORDER BY p.id, x.option_id"
+
+#define MYSQL_GET_POOL6_RANGE_WITH_TAG(...) \
+    MYSQL_GET_POOL6_COMMON( \
+    "INNER JOIN dhcp6_subnet_server AS s ON p.subnet_id = s.subnet_id " \
+    "INNER JOIN dhcp6_server AS srv " \
+    " ON (s.server_id = srv.id) OR (s.server_id = 1) ", \
+    __VA_ARGS__)
+
+#define MYSQL_GET_POOL6_RANGE_NO_TAG(...) \
+    MYSQL_GET_POOL6_COMMON("", __VA_ARGS__)
+#endif
+
+#ifndef MYSQL_GET_PD_POOL_COMMON
+#define MYSQL_GET_PD_POOL_COMMON(server_join, ...) \
+    "SELECT" \
+    "  p.id," \
+    "  p.prefix," \
+    "  p.prefix_length," \
+    "  p.delegated_prefix_length," \
+    "  p.subnet_id," \
+    "  p.excluded_prefix," \
+    "  p.excluded_prefix_length," \
+    "  p.client_class," \
+    "  p.require_client_classes," \
+    "  p.user_context," \
+    "  p.modification_ts," \
+    "  x.option_id," \
+    "  x.code," \
+    "  x.value," \
+    "  x.formatted_value," \
+    "  x.space," \
+    "  x.persistent," \
+    "  x.dhcp6_subnet_id," \
+    "  x.scope_id," \
+    "  x.user_context," \
+    "  x.shared_network_name," \
+    "  x.pool_id," \
+    "  x.modification_ts," \
+    "  x.pd_pool_id " \
+    "FROM dhcp6_pd_pool AS p " \
+    server_join \
+    "LEFT JOIN dhcp6_options AS x ON x.scope_id = 6 AND p.id = x.pd_pool_id " \
+    #__VA_ARGS__ \
+    " ORDER BY p.id, x.option_id" \
+
+#define MYSQL_GET_PD_POOL_WITH_TAG(...) \
+    MYSQL_GET_PD_POOL_COMMON( \
+    "INNER JOIN dhcp6_subnet_server AS s ON p.subnet_id = s.subnet_id " \
+    "INNER JOIN dhcp6_server AS srv " \
+    " ON (s.server_id = srv.id) OR (s.server_id = 1) ", \
+    __VA_ARGS__)
+
+#define MYSQL_GET_PD_POOL_NO_TAG(...) \
+    MYSQL_GET_PD_POOL_COMMON("", __VA_ARGS__)
+#endif
+
 #ifndef MYSQL_GET_SHARED_NETWORK4
 #define MYSQL_GET_SHARED_NETWORK4_COMMON(server_join, ...) \
     "SELECT" \
@@ -858,10 +983,6 @@ namespace {
 #ifndef MYSQL_DELETE_OPTION_POOL_RANGE
 #define MYSQL_DELETE_OPTION_POOL_RANGE(table_prefix, ...) \
     "DELETE o FROM " #table_prefix "_options AS o " \
-    "INNER JOIN " #table_prefix "_options_server AS a" \
-    "  ON o.option_id = a.option_id " \
-    "INNER JOIN " #table_prefix "_server AS s" \
-    "  ON a.server_id = s.id " \
     "WHERE " #__VA_ARGS__ \
     "  AND o.pool_id = " \
     "  (SELECT id FROM " #table_prefix "_pool" \
@@ -871,10 +992,6 @@ namespace {
 #ifndef MYSQL_DELETE_OPTION_PD_POOL
 #define MYSQL_DELETE_OPTION_PD_POOL(...) \
     "DELETE o FROM dhcp6_options AS o " \
-    "INNER JOIN dhcp6_options_server AS a" \
-    "  ON o.option_id = a.option_id " \
-    "INNER JOIN dhcp6_server AS s" \
-    "  ON a.server_id = s.id " \
     "WHERE " #__VA_ARGS__ \
     "  AND o.pd_pool_id = " \
     "  (SELECT id FROM dhcp6_pd_pool" \
index 1f974a363c390509f4ee1e40db599c786162391f..55d9e6a227e3a9184cb3fabbc7effa1532d53a68 100644 (file)
@@ -3661,7 +3661,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, createUpdateDeleteSubnetOption4) {
     ASSERT_EQ(3, countRows("dhcp4_options"));
 
     opt_boot_file_name->persistent_ = !opt_boot_file_name->persistent_;
-    cbptr_->createUpdateOption4(ServerSelector::ALL(), subnet->getID(),
+    cbptr_->createUpdateOption4(ServerSelector::ANY(), subnet->getID(),
                                 opt_boot_file_name);
 
     returned_subnet = cbptr_->getSubnet4(ServerSelector::ANY(),
@@ -3730,7 +3730,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, createUpdateDeletePoolOption4) {
     const PoolPtr pool = subnet->getPool(Lease::TYPE_V4, IOAddress("192.0.2.10"));
     ASSERT_TRUE(pool);
     OptionDescriptorPtr opt_boot_file_name = test_options_[0];
-    cbptr_->createUpdateOption4(ServerSelector::ALL(),
+    cbptr_->createUpdateOption4(ServerSelector::ANY(),
                                 pool->getFirstAddress(),
                                 pool->getLastAddress(),
                                 opt_boot_file_name);
@@ -3769,7 +3769,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, createUpdateDeletePoolOption4) {
 
     // Modify the option and update it in the database.
     opt_boot_file_name->persistent_ = !opt_boot_file_name->persistent_;
-    cbptr_->createUpdateOption4(ServerSelector::ALL(),
+    cbptr_->createUpdateOption4(ServerSelector::ANY(),
                                 pool->getFirstAddress(),
                                 pool->getLastAddress(),
                                 opt_boot_file_name);
@@ -3862,7 +3862,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, createUpdateDeleteSharedNetworkOption4) {
     ASSERT_EQ(0, countRows("dhcp4_options"));
 
     OptionDescriptorPtr opt_boot_file_name = test_options_[0];
-    cbptr_->createUpdateOption4(ServerSelector::ALL(),
+    cbptr_->createUpdateOption4(ServerSelector::ANY(),
                                 shared_network->getName(),
                                 opt_boot_file_name);
 
@@ -3895,7 +3895,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, createUpdateDeleteSharedNetworkOption4) {
     ASSERT_EQ(1, countRows("dhcp4_options"));
 
     opt_boot_file_name->persistent_ = !opt_boot_file_name->persistent_;
-    cbptr_->createUpdateOption4(ServerSelector::ALL(),
+    cbptr_->createUpdateOption4(ServerSelector::ANY(),
                                 shared_network->getName(),
                                 opt_boot_file_name);
 
index 0e9af6451683be03dc4a1f97f5be2db24dca9d9d..b5a8e383587fdbd5ce6b085176c2c83cd165266c 100644 (file)
@@ -3669,7 +3669,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeleteSubnetOption6) {
     ASSERT_EQ(4, countRows("dhcp6_options"));
 
     OptionDescriptorPtr opt_posix_timezone = test_options_[0];
-    cbptr_->createUpdateOption6(ServerSelector::ALL(), subnet->getID(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(), subnet->getID(),
                                 opt_posix_timezone);
 
     returned_subnet = cbptr_->getSubnet6(ServerSelector::ALL(),
@@ -3702,7 +3702,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeleteSubnetOption6) {
     ASSERT_EQ(5, countRows("dhcp6_options"));
 
     opt_posix_timezone->persistent_ = !opt_posix_timezone->persistent_;
-    cbptr_->createUpdateOption6(ServerSelector::ALL(), subnet->getID(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(), subnet->getID(),
                                 opt_posix_timezone);
 
     returned_subnet = cbptr_->getSubnet6(ServerSelector::ALL(),
@@ -3772,7 +3772,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeletePoolOption6) {
                                          IOAddress("2001:db8::10"));
     ASSERT_TRUE(pool);
     OptionDescriptorPtr opt_posix_timezone = test_options_[0];
-    cbptr_->createUpdateOption6(ServerSelector::ALL(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(),
                                 pool->getFirstAddress(),
                                 pool->getLastAddress(),
                                 opt_posix_timezone);
@@ -3811,7 +3811,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeletePoolOption6) {
 
     // Modify the option and update it in the database.
     opt_posix_timezone->persistent_ = !opt_posix_timezone->persistent_;
-    cbptr_->createUpdateOption6(ServerSelector::ALL(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(),
                                 pool->getFirstAddress(),
                                 pool->getLastAddress(),
                                 opt_posix_timezone);
@@ -3903,7 +3903,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeletePdPoolOption6) {
     OptionDescriptorPtr opt_posix_timezone = test_options_[0];
     int pd_pool_len = prefixLengthFromRange(pd_pool->getFirstAddress(),
                                             pd_pool->getLastAddress());
-    cbptr_->createUpdateOption6(ServerSelector::ALL(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(),
                                 pd_pool->getFirstAddress(),
                                 static_cast<uint8_t>(pd_pool_len),
                                 opt_posix_timezone);
@@ -3943,7 +3943,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeletePdPoolOption6) {
 
     // Modify the option and update it in the database.
     opt_posix_timezone->persistent_ = !opt_posix_timezone->persistent_;
-    cbptr_->createUpdateOption6(ServerSelector::ALL(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(),
                                 pd_pool->getFirstAddress(),
                                 static_cast<uint8_t>(pd_pool_len),
                                 opt_posix_timezone);
@@ -4037,7 +4037,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeleteSharedNetworkOption6) {
     ASSERT_EQ(0, countRows("dhcp6_options"));
 
     OptionDescriptorPtr opt_posix_timezone = test_options_[0];
-    cbptr_->createUpdateOption6(ServerSelector::ALL(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(),
                                 shared_network->getName(),
                                 opt_posix_timezone);
 
@@ -4070,7 +4070,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, createUpdateDeleteSharedNetworkOption6) {
     ASSERT_EQ(1, countRows("dhcp6_options"));
 
     opt_posix_timezone->persistent_ = !opt_posix_timezone->persistent_;
-    cbptr_->createUpdateOption6(ServerSelector::ALL(),
+    cbptr_->createUpdateOption6(ServerSelector::ANY(),
                                 shared_network->getName(),
                                 opt_posix_timezone);