Update DHCPv6 server to fully support RFC7550 (obsoleted by RFC 8415)
While addressing #288 (closed) I realized that DHCPv6 server logic follows rather simplified approach when it comes to Renew/Rebind processing. The following is the todo comment inserted as part of the #288 (closed):
We should consider unification of the server behavior for address assignment and prefix delegation with respect to Rebind message processing. The RFC 8415, section 18.3.5 doesn't really differentiate between IA_NA and IA_PD in how they should be processed by the server. The intention of the spec is as follows:
- If the server finds a lease but addresses and/or prefixes are not appropriate anymore, it sends them with zero lifetimes.
- If the server doesn't find a lease the server checks if the addresses and/or prefixes the client sends are appropriate and sends them back with zero lifetimes if they aren't.
- The server may choose to not respond at all, if it cannot determine whether the addresses and/or prefixes are appropriate and it doesn't allocate any other addresses and/or prefixes.
- If the server cannot find the leases included in the Rebind, the server may either allocate the leases or simply return NoBinding.
The extendIA_PD function drops the Rebind message if it cannot find the client entry (as a result of not finding a subnet for the client), the extendIA_NA function sends NoBinding status code in that case. Perhaps we should introduce an "Authoritative" configuration flag which, if enabled, would cause the server to always respond, either indicating that the address/prefix is inappropriate (with zero lifetimes) or that there is no binding (NoBinding status code) for both addresses and prefixes. When the "Authoritative" flag is disabled the server would drop the Rebind for which there is neither subnet selected nor client entry found (as it could be handled by another DHCP server). If nothing else we could consider unifying the behavior of extendIA_NA and extendIA_PD with respect to Rebind processing.