From: Razvan Becheriu Date: Wed, 3 Mar 2021 11:26:05 +0000 (+0200) Subject: [#1680] consistent order of parameters in hook points X-Git-Tag: Kea-1.9.8~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd91e0b25272bdde3c6a8fbc344aef4228feddde;p=thirdparty%2Fkea.git [#1680] consistent order of parameters in hook points --- diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index ef19c45743..cfdc9c7fa3 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -1441,12 +1441,12 @@ Dhcpv4Srv::processPacketPktSend(hooks::CalloutHandlePtr& callout_handle, // hook library. ScopedEnableOptionsCopy query_resp_options_copy(query, rsp); + // Pass incoming packet as argument + callout_handle->setArgument("query4", query); + // Set our response callout_handle->setArgument("response4", rsp); - // Also pass the corresponding query packet as argument - callout_handle->setArgument("query4", query); - // Call all installed callouts HooksManager::callCallouts(Hooks.hook_index_pkt4_send_, *callout_handle); diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc index 251133427d..2c5d96fc12 100644 --- a/src/lib/dhcpsrv/alloc_engine.cc +++ b/src/lib/dhcpsrv/alloc_engine.cc @@ -1959,6 +1959,8 @@ Lease6Ptr AllocEngine::createLease6(ClientContext6& ctx, // Is this solicit (fake = true) or request (fake = false) ctx.callout_handle_->setArgument("fake_allocation", ctx.fake_allocation_); + + // The lease that will be assigned to a client ctx.callout_handle_->setArgument("lease6", lease); // This is the first callout, so no need to clear any arguments @@ -4167,8 +4169,7 @@ AllocEngine::reuseExpiredLease4(Lease4Ptr& expired, ctx.callout_handle_->setArgument("subnet4", subnet4); // Is this solicit (fake = true) or request (fake = false) - ctx.callout_handle_->setArgument("fake_allocation", - ctx.fake_allocation_); + ctx.callout_handle_->setArgument("fake_allocation", ctx.fake_allocation_); // The lease that will be assigned to a client ctx.callout_handle_->setArgument("lease4", expired);