summaryrefslogtreecommitdiff
path: root/server/omapi.c
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2006-10-27 22:54:13 +0000
committerDavid Hankins <dhankins@isc.org>2006-10-27 22:54:13 +0000
commit6708d944e10cae7164cef0c00e44b7f9edcf9160 (patch)
tree0b5f67bf524ee4bd4bb19d98b9294eb8a794bece /server/omapi.c
parent66c8f7347aee4c6a72f1915d199ac64cde8a7adb (diff)
downloadisc-dhcp-6708d944e10cae7164cef0c00e44b7f9edcf9160.tar.gz
- 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]
Diffstat (limited to 'server/omapi.c')
-rw-r--r--server/omapi.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/server/omapi.c b/server/omapi.c
index 3cd66284..4caf8e34 100644
--- a/server/omapi.c
+++ b/server/omapi.c
@@ -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)