requestLease4 algorithm (Kea 1.8.0)
get lease for the client
reserved address
yes
no
requested address
no
yes
requested address = reserved address
return no lease
yes
requested address is reserved for another client
no
return no lease
yes
active and owned by another client
no
yes
lease for requested address
no
return no lease
yes
active
no
yes
lease for requested address
no
return no lease
no
requested address in allowed pool
yes
no
requested address == reserved address
yes
requested address
yes
no
return no lease
yes
requested address is reserved for another client
no
return no lease
yes
active and owned by another client
no
yes
lease for requested address
no
return no lease
no
requested address in allowed pool
yes
pick candidate address
lease for candidate
no
yes
create and return new lease
reclaim expired lease
update lease information
callout lease4_select
callout return
SKIP
CONTINUE
return no lease
update lease
return reused lease
yes
expired
no
no
candidate is used by another thread
yes
no
candidate is reserved for another client
yes
iterate over pools and subnets
maximum attempts
return no lease
no
client lease and lease address in allowed pool
yes
update lease information
reclaim expired lease
yes
old lease expired
no
callout lease4_renew
callout return
SKIP
CONTINUE
return old client lease
update lease
return renewed client lease
yes
has reserved address or client lease address in allowed pool
no
yes
no requested address or requested address == client lease address
no
yes
client lease
no
get lease for requested address
requested lease
yes
no
expired
no
yes
return no lease
reclaim expired lease
update lease information
callout lease4_select
callout return
SKIP
CONTINUE
return no lease
update lease
return reused lease
create and return new lease