]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5605a] Minor changes after review:
authorTomek Mrugalski <tomasz@isc.org>
Mon, 7 May 2018 15:25:17 +0000 (17:25 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Mon, 7 May 2018 15:25:17 +0000 (17:25 +0200)
 - comments added

src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/dhcp4_srv.h

index e3430f515cffe88574cbdb9aa4c28cb974892174..ddd6043370c678c6b98cfabe8de891339d52de54 100644 (file)
@@ -547,6 +547,7 @@ Dhcpv4Srv::selectSubnet(const Pkt4Ptr& query, bool& drop,
     subnet = cfgmgr.getCurrentCfg()->getCfgSubnets4()->selectSubnet(selector);
 
     // Let's execute all callouts registered for subnet4_select
+    // (skip callouts if the selectSubnet was called to do sanity checks only)
     if (!sanity_only &&
         HooksManager::calloutsPresent(Hooks.hook_index_subnet4_select_)) {
         CalloutHandlePtr callout_handle = getCalloutHandle(query);
@@ -663,7 +664,8 @@ Dhcpv4Srv::selectSubnet4o6(const Pkt4Ptr& query, bool& drop,
     CfgMgr& cfgmgr = CfgMgr::instance();
     subnet = cfgmgr.getCurrentCfg()->getCfgSubnets4()->selectSubnet4o6(selector);
 
-    // Let's execute all callouts registered for subnet4_select
+    // Let's execute all callouts registered for subnet4_select.
+    // (skip callouts if the selectSubnet was called to do sanity checks only)
     if (!sanity_only &&
         HooksManager::calloutsPresent(Hooks.hook_index_subnet4_select_)) {
         CalloutHandlePtr callout_handle = getCalloutHandle(query);
index 8656de8f8984f36abb6f7d5622ca2ce78a35c09c..3d8c46440d37816522dbfb87fe9b02999c0afba0 100644 (file)
@@ -790,6 +790,11 @@ protected:
 
     /// @brief Selects a subnet for a given client's packet.
     ///
+    /// If selectSubnet is called to simply do sanity checks (check if a
+    /// subnet would be selected), then there is no need to call hooks,
+    /// as this will happen later (when selectSubnet is called again).
+    /// In such case the sanity_only should be set to true.
+    ///
     /// @param query client's message
     /// @param drop if it is true the packet will be dropped
     /// @param sanity_only if it is true the callout won't be called
@@ -800,6 +805,11 @@ protected:
 
     /// @brief Selects a subnet for a given client's DHCP4o6 packet.
     ///
+    /// If selectSubnet is called to simply do sanity checks (check if a
+    /// subnet would be selected), then there is no need to call hooks,
+    /// as this will happen later (when selectSubnet is called again).
+    /// In such case the sanity_only should be set to true.
+    ///
     /// @param query client's message
     /// @param drop if it is true the packet will be dropped
     /// @param sanity_only if it is true the callout won't be called