Date: | Mon, 30 Apr 2018 13:48:44 +0000 |
From: | tmark@isc.org |
To: | dhcp-public@isc.org |
Subject: | Server delegates previously owned prefix even though the client's network has changed |
If a client releases a delegated prefix and then returns on another network and uses that prefix as a prefix hint, the server will still delegate the prefix.
The server should be ensuring that the client is on the same network as it was when it originally owned the prefix.
The attached patch adds a check to prefix_is_owned().
Subject: | 12729.diff |
diff --git a/server/dhcpv6.c b/server/dhcpv6.c
index a7110f9..b385079 100644
--- a/server/dhcpv6.c
+++ b/server/dhcpv6.c
@@ -4747,9 +4747,17 @@ prefix_is_owned(struct reply_state *reply, struct iaddrcidrnet *pref) {
for (i = 0 ; i < reply->old_ia->num_iasubopt ; i++) {
struct iasubopt *tmp;
+ struct shared_network *candidate_shared;
tmp = reply->old_ia->iasubopt[i];
+ /* We can only use it if it comes from a pool within
+ * the client's network */
+ candidate_shared = tmp->ipv6_pool->shared_network;
+ if (candidate_shared != reply->shared) {
+ continue;
+ }
+
if ((pref->bits == (int) tmp->plen) &&
(memcmp(pref->lo_addr.iabuf, &tmp->addr, 16) == 0)) {
if (lease6_usable(tmp) == ISC_FALSE) {