[Kea-users] Bug in the leases4_committed hook ?

Marcin Siodelski marcin at isc.org
Fri Sep 21 13:22:02 UTC 2018


Hello,

You seem to have the type of the arguments wrong. It should rather be:

Pkt4Ptr query4;
Lease4CollectionPtr leases4;
Lease4CollectionPtr deleted_leases4;

We implemented collection of leases in this hook point for DHCPv4 to
keep parity with DHCPv6. In most cases, these collections will store at
most one lease.

Marcin Siodelski

DHCP Engineering
ISC

On 21.09.2018 14:55, Hreiðar Jóelsson wrote:
> Hi, I’m any of you had problems with the leases4_committed hook? I’m
> getting strange errors using it. If I simply try to log some message
> from it I’m getting the following error.
> 
>  
> 
> 2018-09-21 10:57:04.843 ERROR [kea-dhcp4.callouts/1442]
> HOOKS_CALLOUT_EXCEPTION exception thrown by callout on hook 1 registered
> by library with index leases4_committed (callout address
> 0x7f8803d131c3): boost::bad_any_cast: failed conversion using
> boost::any_cast (callout duration: 0.063 ms)
> 
>  
> 
> Here is the hook code I’m currently using:
> 
>  
> 
> int leases4_committed(CalloutHandle& handle) {
> 
>     Pkt4Ptr query;
> 
>     Lease4Ptr leases, deleted_leases;
> 
>     handle.getArgument("query4", query);
> 
>     handle.getArgument("leases4", leases);
> 
>     handle.getArgument("deleted_leases4", deleted_leases);
> 
>  
> 
>     LOG_DEBUG(my_logger,50, "I'm at leases4_committed hook");
> 
>  
> 
>     return 0;
> 
> }
> 
>  
> 
> p.s I’m using this logger in other hooks in the same file without any
> problems.
> 
>  
> 
>  
> 
> Regards, Hreiðar.
> 
>  
> 
> 
> 
> _______________________________________________
> Kea-users mailing list
> Kea-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
> 




More information about the Kea-users mailing list