summaryrefslogtreecommitdiff
path: root/server/confpars.c
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2014-06-05 14:55:01 -0700
committerShawn Routhier <sar@isc.org>2014-06-05 14:55:01 -0700
commit250f7134bbe06f5014ab12dfd8a459c9b39e17cb (patch)
tree1c133ba8b68a77c044bd8259e52f9afd9e5e607e /server/confpars.c
parent0ab4a716125d7945645bc0b3935c052edee0e97d (diff)
downloadisc-dhcp-250f7134bbe06f5014ab12dfd8a459c9b39e17cb.tar.gz
[master] Add support for pool thresholds
Add support to set high and low thresholds for pools for v4 and v6. A message will be emitted when the usage of the pool first exceeds the high threshold. More messages will be skipped until the usage has gone below the low threshold and then back above the high threshold.
Diffstat (limited to 'server/confpars.c')
-rw-r--r--server/confpars.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/confpars.c b/server/confpars.c
index a8fe1fb4..8a5a4b33 100644
--- a/server/confpars.c
+++ b/server/confpars.c
@@ -3837,6 +3837,12 @@ add_ipv6_pool_to_subnet(struct subnet *subnet, u_int16_t type,
*/
ipv6_pool_reference(&pond->ipv6_pools[num_pools], pool, MDL);
pond->ipv6_pools[num_pools+1] = NULL;
+ /* Update the number of elements in the pond. Conveniently
+ * we have the total size of the block in bits and the amount
+ * we would allocate per element in units. For an address units
+ * will always be 128, for a prefix it will be something else.
+ */
+ pond->num_total += 1 << (units - bits);
}
/*!