]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1781] Additional review comments
authorThomas Markwalder <tmark@isc.org>
Tue, 19 Jul 2022 20:15:58 +0000 (16:15 -0400)
committerThomas Markwalder <tmark@isc.org>
Wed, 20 Jul 2022 13:04:59 +0000 (09:04 -0400)
src/hooks/dhcp/high_availability/query_filter.h
    Added commentary

src/hooks/dhcp/high_availability/tests/query_filter_unittest.cc
    Added commentary

src/hooks/dhcp/high_availability/query_filter.h
src/hooks/dhcp/high_availability/tests/query_filter_unittest.cc

index 0094d247b8651368774384d4808716eddf05d930..003bc891218395d89f240d75d9be1badf67ce2ac 100644 (file)
@@ -138,9 +138,17 @@ public:
 
     /// @brief Checks if this server should process the DHCPv4 query.
     ///
-    /// This method takes into account enabled scopes for this server and
-    /// HA mode to determine whether this query should be processed. It
-    /// triggers load balancing when load balancing mode is enabled.
+    /// This method uses a table of DHCPv4 message types to determine whether or
+    /// not a query needs further analysis to determine which HA server
+    /// should handle it or if it should simply be processed by this server.
+    ///
+    /// For message types that qualify (e.g. DHCPDISCOVER, DHCPREQUEST, etc),
+    /// it then takes into account enabled scopes for this server and HA mode
+    /// to determine whether this query should be processed. It triggers load
+    /// balancing when load balancing mode is enabled.
+    ///
+    /// Non-qualifying message types (e.g. DHCPLEASEQUERY) are passed
+    /// through for handling by this server.
     ///
     /// @param query4 pointer to the DHCPv4 query instance.
     /// @param [out] scope_class name of the class which corresponds to the
@@ -154,9 +162,17 @@ public:
 
     /// @brief Checks if this server should process the DHCPv6 query.
     ///
-    /// This method takes into account enabled scopes for this server and
-    /// HA mode to determine whether this query should be processed. It
-    /// triggers load balancing when load balancing mode is enabled.
+    /// This method uses a table of DHCPv6 message types to determine whether or
+    /// not a query needs further analysis to determine which HA server
+    /// should handle it or if it should simply be processed by this server.
+    ///
+    /// For message types that qualify (e.g. DHCPV6_SOLICIT, DHCPV6_REQUEST, etc),
+    /// it then takes into account enabled scopes for this server and HA mode
+    /// to determine whether this query should be processed. It triggers load
+    /// balancing when load balancing mode is enabled.
+    ///
+    /// Non-qualifying message types (e.g. DHCPV6_LEASEQUERY) are passed through
+    /// for handling by this server.
     ///
     /// @param query6 pointer to the DHCPv6 query instance.
     /// @param [out] scope_class name of the class which corresponds to the
index a9c4a69f51cfc8e568c496445d79ce8b73647d9c..4f7f2c4f27794cb26e95fca29f6f2bea8ebc530a 100644 (file)
@@ -768,7 +768,9 @@ QueryFilterTest::loadBalancingHaTypes4() {
     ASSERT_TRUE(server1_pkt && server2_pkt) << "do not have both scopes in "
                 << max_scope_tries << ", load balance broken?";
 
-    // We exceed DHCP_TYPES_EOF just to be sure.
+    // Iterate over message types.  While setting message type to zero is
+    // semantically invalid, it is useful for testing here. Similarly we exceed
+    // DHCP_TYPES_EOF just to be sure.
     for (uint8_t msg_type = 0; msg_type < DHCP_TYPES_EOF + 2; ++msg_type) {
         // All message types should be in scope for server1.
         server1_pkt->setType(msg_type);
@@ -844,7 +846,9 @@ QueryFilterTest::loadBalancingHaTypes6() {
     ASSERT_TRUE(server1_pkt && server2_pkt) << "do not have both scopes in "
                 << max_scope_tries << ", load balance broken?";
 
-    // We exceed DHCPV6_TYPES_EOF just to be sure.
+    // Iterate over message types.  While setting message type to zero is
+    // semantically invalid, it is useful for testing here. Similarly we exceed
+    // DHCPV6_TYPES_EOF just to be sure.
     for (uint8_t msg_type = 0; msg_type < DHCPV6_TYPES_EOF + 2; ++msg_type) {
         // All message types should be in scope for server1.
         server1_pkt->setType(msg_type);