[Kea-users] Need help assigning subnets by class with host reservations

Thomas Markwalder tmark at isc.org
Tue Nov 15 16:37:32 UTC 2016


On 11/15/16 11:16 AM, MRob wrote:
> On 2016-11-15 07:54, MRob wrote:
>> On 2016-11-15 04:51, Thomas Markwalder wrote:
>>> On 11/15/16 7:41 AM, Thomas Markwalder wrote:
>>>
>>> Sorry, it would need to be at least this:
>>>
>>> diff --git a/src/lib/dhcpsrv/alloc_engine.cc
>>> b/src/lib/dhcpsrv/alloc_engine.cc
>>> index bc37eeb..0a5e446 100644
>>> --- a/src/lib/dhcpsrv/alloc_engine.cc
>>> +++ b/src/lib/dhcpsrv/alloc_engine.cc
>>> @@ -2841,6 +2841,11 @@
>>> AllocEngine::allocateUnreservedLease4(ClientContext4& ctx) {
>>>              new_lease = allocateOrReuseLease4(candidate, ctx);
>>>              if (new_lease) {
>>>                  return (new_lease);
>>> +            } else {
>>> +                if (ctx.callout_handle_ &&
>>
>> You need to remove the opening brace on the next line (or add a
>> closing one).
>>
>>> +                    ctx.callout_handle_->getStatus() ==
>>> CalloutHandle::NEXT_STEP_SKIP) {
>>> +                    break;
>>> +                }
>>>              }
>>>          }
>>>      }
>>
>> Initial testing shows this seems to fix the problem. Thank you for the
>> quick patch.
>
> Though this is what gets logged:
>
> WARN  [kea-dhcp4.alloc-engine] ALLOC_ENGINE_V4_ALLOC_FAIL [hwtype=1
> aa:bb:cc:dd:ee:ff], cid=[01:aa:bb:cc:dd:ee:ff], tid=0x4a35b190: failed
> to allocate an IPv4 address after 151 attempt(s)
>
> My reading of the log is that this is logged after only a single lease
> request, so I think it's just an assumption in the code about why the
> lease failed.
Glad it's working for you.  The formal fix will likely be included in
1.2.  We appreciate you being a lab rat for us.   Yes, the log you see
is simply because the patch breaks the for loop and executes that log. 
Since the skip should actually already be getting logged you could
replace the break statement with a return(new_lease).  This would
eliminate the somewhat misleading log.

We have a web page where we can post people's hooks if they care to
share them, http://kea.isc.org/wiki/Hooks.  If at some point you would
like to share yours,  just let us know and we can add you.

Cheers,

Thomas Markwalder
ISC Software Engineering
> _______________________________________________
> 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