2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#899] fixed hook point arguments

This commit is contained in:
Razvan Becheriu
2021-01-29 10:34:33 +02:00
parent 84ada292c8
commit 812fb67d8b
3 changed files with 13 additions and 9 deletions

View File

@@ -3330,10 +3330,12 @@ Dhcpv4Srv::declineLease(const Lease4Ptr& lease, const Pkt4Ptr& decline,
// Enable copying options from the packet within hook library.
ScopedEnableOptionsCopy<Pkt4> query4_options_copy(decline);
// Pass incoming Decline and the lease to be declined.
callout_handle->setArgument("lease4", lease);
// Pass the original packet
callout_handle->setArgument("query4", decline);
// Pass the lease to be updated
callout_handle->setArgument("lease4", lease);
// Call callouts
HooksManager::callCallouts(Hooks.hook_index_lease4_decline_,
*callout_handle);

View File

@@ -3587,8 +3587,10 @@ Dhcpv6Srv::declineLease(const Pkt6Ptr& decline, const Lease6Ptr lease,
// Enable copying options from the packet within hook library.
ScopedEnableOptionsCopy<Pkt6> query6_options_copy(decline);
// Pass incoming packet as argument
// Pass the original packet
callout_handle->setArgument("query6", decline);
// Pass the lease to be updated
callout_handle->setArgument("lease6", lease);
// Call callouts

View File

@@ -146,9 +146,9 @@ int leases4_committed(CalloutHandle& handle) {
Pkt4Ptr pkt4;
handle.getArgument("query4", pkt4);
RunScriptImpl::extractPkt4(vars, pkt4);
Lease4Ptr lease4;
handle.getArgument("lease4", lease4);
RunScriptImpl::extractLease4(vars, lease4);
Lease4CollectionPtr leases4;
handle.getArgument("leases4", leases4);
RunScriptImpl::extractLeases4(vars, leases4);
Lease4CollectionPtr deleted_leases4;
handle.getArgument("deleted_leases4", deleted_leases4);
RunScriptImpl::extractLeases4(vars, deleted_leases4);
@@ -307,9 +307,9 @@ int leases6_committed(CalloutHandle& handle) {
Pkt6Ptr pkt6;
handle.getArgument("query6", pkt6);
RunScriptImpl::extractPkt6(vars, pkt6);
Lease6Ptr lease6;
handle.getArgument("lease6", lease6);
RunScriptImpl::extractLease6(vars, lease6);
Lease6CollectionPtr leases6;
handle.getArgument("leases6", leases6);
RunScriptImpl::extractLeases6(vars, leases6);
Lease6CollectionPtr deleted_leases6;
handle.getArgument("deleted_leases6", deleted_leases6);
RunScriptImpl::extractLeases6(vars, deleted_leases6);