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);
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);
/// @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
/// @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