summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2011-01-20 20:44:43 +0000
committerShawn Routhier <sar@isc.org>2011-01-20 20:44:43 +0000
commit2e1ac385618a9dd42611b39d6032abc848771eeb (patch)
tree871528e15ad61fea7d6b507db943767404eaffd7
parent3b9e526f3133b3aefe3d56a81a5a54ba84fc186e (diff)
downloadisc-dhcp-2e1ac385618a9dd42611b39d6032abc848771eeb.tar.gz
When processing a request in the DHCPv6 server code that specifies
an address that is tagged as abondened (meaning we received a decline request for it previously) don't attempt to move it from the inactive to active pool as doing so can result in the server crshing on an assert failure. Also retag the lease as active and reset it's timeout value. [ISC-Bugs #21921]
-rw-r--r--RELNOTES8
-rw-r--r--server/mdb6.c19
2 files changed, 24 insertions, 3 deletions
diff --git a/RELNOTES b/RELNOTES
index 1f8e1f87..161f3dd6 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -69,6 +69,14 @@ work on other platforms. Please report any problems and suggested fixes to
option. Thanks to a patch from Marius Tomaschewski.
[ISC-Bugs #22055]
+! When processing a request in the DHCPv6 server code that specifies
+ an address that is tagged as abondened (meaning we received a
+ decline request for it previously) don't attempt to move it from
+ the inactive to active pool as doing so can result in the server
+ crshing on an assert failure. Also retag the lease as active
+ and reset it's timeout value.
+ [ISC-Bugs #21921]
+
Changes since 4.1.2rc1
! Handle a relay forward message with an unspecified address in the
diff --git a/server/mdb6.c b/server/mdb6.c
index e77512bb..56dd44b5 100644
--- a/server/mdb6.c
+++ b/server/mdb6.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2010-2011 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2007-2008 by Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and distribute this software for any
@@ -1009,7 +1009,7 @@ move_lease_to_active(struct ipv6_pool *pool, struct iasubopt *lease) {
* Renew an lease in the pool.
*
* To do this, first set the new hard_lifetime_end_time for the resource,
- * and then invoke renew_lease() on it.
+ * and then invoke renew_lease6() on it.
*
* WARNING: lease times must only be extended, never reduced!!!
*/
@@ -1019,12 +1019,24 @@ renew_lease6(struct ipv6_pool *pool, struct iasubopt *lease) {
* If we're already active, then we can just move our expiration
* time down the heap.
*
+ * If we're abandoned then we are already on the active list
+ * but we need to retag the lease and move our expiration
+ * from infinite to the current value
+ *
* Otherwise, we have to move from the inactive heap to the
* active heap.
*/
if (lease->state == FTS_ACTIVE) {
isc_heap_decreased(pool->active_timeouts, lease->heap_index);
return ISC_R_SUCCESS;
+ } else if (lease->state == FTS_ABANDONED) {
+ char tmp_addr[INET6_ADDRSTRLEN];
+ lease->state = FTS_ACTIVE;
+ isc_heap_increased(pool->active_timeouts, lease->heap_index);
+ log_info("Reclaiming previously abandoned address %s",
+ inet_ntop(AF_INET6, &(lease->addr), tmp_addr,
+ sizeof(tmp_addr)));
+ return ISC_R_SUCCESS;
} else {
return move_lease_to_active(pool, lease);
}
@@ -1112,7 +1124,8 @@ isc_result_t
decline_lease6(struct ipv6_pool *pool, struct iasubopt *lease) {
isc_result_t result;
- if (lease->state != FTS_ACTIVE) {
+ if ((lease->state != FTS_ACTIVE) &&
+ (lease->state != FTS_ABANDONED)) {
result = move_lease_to_active(pool, lease);
if (result != ISC_R_SUCCESS) {
return result;