]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1680] consistent order of parameters in hook points
authorRazvan Becheriu <razvan@isc.org>
Wed, 3 Mar 2021 11:26:05 +0000 (13:26 +0200)
committerRazvan Becheriu <razvan@isc.org>
Wed, 5 May 2021 17:12:17 +0000 (20:12 +0300)
src/bin/dhcp4/dhcp4_srv.cc
src/lib/dhcpsrv/alloc_engine.cc

index ef19c45743cf45b69b5fb07c26e268e79f0740a7..cfdc9c7fa3321145f9cb21a623a06f7aee6dd1b0 100644 (file)
@@ -1441,12 +1441,12 @@ Dhcpv4Srv::processPacketPktSend(hooks::CalloutHandlePtr& callout_handle,
         // hook library.
         ScopedEnableOptionsCopy<Pkt4> 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);
index 251133427d1732f288a2045ef09aa919ae03349f..2c5d96fc1281a46d875593e1ef70830bf4fe6814 100644 (file)
@@ -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);