2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

- Some default hash table sizes were tweaked, some upwards, some downwards.

3.1.0a1's tables resulted in a reduction in default server memory use.
  The new selected values provide more of a zero sum (increasing the size
  of tables likely to be populated, decreasing the size of tables unlikely).

- Lease structures appear in three spearate hashes: by IP address, by UID,
  and by hardware address.  One type of table was used for all three, and
  improvements to IP address hashing were applied to all three (so UID and
  hardware addresses were treated like 4-byte integers).  There are now two
  types of tables, and the uid/hw hashes use functions more appropriate
  to their needs.

- The max-lease-misbalance percentage no longer causes scheduled rebalance
  runs to be skipped: it still governs the schedule, but every scheduled
  run will attempt balance.

[ISC-Bugs #16396]
This commit is contained in:
David Hankins
2006-10-27 22:54:13 +00:00
parent 66c8f7347a
commit 6708d944e1
10 changed files with 290 additions and 104 deletions

View File

@@ -41,7 +41,7 @@
#ifndef lint
static char copyright[] =
"$Id: omapi.c,v 1.58 2006/06/01 20:23:17 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
"$Id: omapi.c,v 1.59 2006/10/27 22:54:13 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -755,9 +755,9 @@ isc_result_t dhcp_lease_lookup (omapi_object_t **lp,
status = omapi_get_value_str (ref, id, "ip-address", &tv);
if (status == ISC_R_SUCCESS) {
lease = (struct lease *)0;
lease_hash_lookup (&lease, lease_ip_addr_hash,
tv -> value -> u.buffer.value,
tv -> value -> u.buffer.len, MDL);
lease_ip_hash_lookup(&lease, lease_ip_addr_hash,
tv->value->u.buffer.value,
tv->value->u.buffer.len, MDL);
omapi_value_dereference (&tv, MDL);
@@ -784,9 +784,9 @@ isc_result_t dhcp_lease_lookup (omapi_object_t **lp,
status = omapi_get_value_str (ref, id, "dhcp-client-identifier", &tv);
if (status == ISC_R_SUCCESS) {
lease = (struct lease *)0;
lease_hash_lookup (&lease, lease_uid_hash,
tv -> value -> u.buffer.value,
tv -> value -> u.buffer.len, MDL);
lease_id_hash_lookup(&lease, lease_uid_hash,
tv->value->u.buffer.value,
tv->value->u.buffer.len, MDL);
omapi_value_dereference (&tv, MDL);
if (*lp && *lp != (omapi_object_t *)lease) {
@@ -858,7 +858,8 @@ isc_result_t dhcp_lease_lookup (omapi_object_t **lp,
}
lease = (struct lease *)0;
lease_hash_lookup (&lease, lease_hw_addr_hash, haddr, len, MDL);
lease_id_hash_lookup(&lease, lease_hw_addr_hash, haddr, len,
MDL);
dfree (haddr, MDL);
if (*lp && *lp != (omapi_object_t *)lease) {
@@ -1480,9 +1481,9 @@ isc_result_t dhcp_host_lookup (omapi_object_t **lp,
/* first find the lease for this ip address */
l = (struct lease *)0;
lease_hash_lookup (&l, lease_ip_addr_hash,
tv -> value -> u.buffer.value,
tv -> value -> u.buffer.len, MDL);
lease_ip_hash_lookup(&l, lease_ip_addr_hash,
tv->value->u.buffer.value,
tv->value->u.buffer.len, MDL);
omapi_value_dereference (&tv, MDL);
if (!l && !*lp)