2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-22 01:49:35 +00:00

- supersede_lease() now requeues leases in their respective hardware

address hash bucket.  This mirrors client identifier behaviour.
  [ISC-Bugs #16936]
This commit is contained in:
David Hankins 2007-06-08 18:56:30 +00:00
parent c62c07ef6a
commit b8221d9512
2 changed files with 22 additions and 28 deletions

View File

@ -372,6 +372,11 @@ suggested fixes to <dhcp-users@isc.org>.
- Encapsulated option spaces within encapsulated option spaces is now
formally supported.
Changes since 3.0.6rc1
- supersede_lease() now requeues leases in their respective hardware
address hash bucket. This mirrors client identifier behaviour.
Changes since 3.0.5
- Assorted fixes for broken network devices: Packet length is now

View File

@ -34,7 +34,7 @@
#ifndef lint
static char copyright[] =
"$Id: mdb.c,v 1.91 2007/05/19 19:16:27 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
"$Id: mdb.c,v 1.92 2007/06/08 18:56:30 dhankins Exp $ Copyright (c) 2004-2007 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -1064,8 +1064,6 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
int propogate;
int pimmediate;
{
int enter_uid = 0;
int enter_hwaddr = 0;
struct lease *lp, **lq, *prev;
TIME lp_next_state;
#if defined (FAILOVER_PROTOCOL)
@ -1113,28 +1111,21 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
/* If there's a Unique ID, dissociate it from the hash
table and free it if necessary. */
if (comp -> uid) {
uid_hash_delete (comp);
enter_uid = 1;
if (comp -> uid != &comp -> uid_buf [0]) {
dfree (comp -> uid, MDL);
comp -> uid_max = 0;
comp -> uid_len = 0;
if (comp->uid) {
uid_hash_delete(comp);
if (comp->uid != comp->uid_buf) {
dfree(comp->uid, MDL);
comp->uid_max = 0;
comp->uid_len = 0;
}
comp -> uid = (unsigned char *)0;
} else
enter_uid = 1;
}
if (comp -> hardware_addr.hlen &&
((comp -> hardware_addr.hlen !=
lease -> hardware_addr.hlen) ||
memcmp (comp -> hardware_addr.hbuf,
lease -> hardware_addr.hbuf,
comp -> hardware_addr.hlen))) {
hw_hash_delete (comp);
enter_hwaddr = 1;
} else if (!comp -> hardware_addr.hlen)
enter_hwaddr = 1;
/* If there's a hardware address, remove the lease from its
* old position in the hash bucket's ordered list.
*/
if (comp->hardware_addr.hlen)
hw_hash_delete(comp);
/* If the lease has been billed to a class, remove the billing. */
if (comp -> billing_class != lease -> billing_class) {
@ -1224,14 +1215,12 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
}
/* Record the lease in the uid hash if necessary. */
if (enter_uid && comp -> uid) {
uid_hash_add (comp);
}
if (comp->uid)
uid_hash_add(comp);
/* Record it in the hardware address hash if necessary. */
if (enter_hwaddr && lease -> hardware_addr.hlen) {
hw_hash_add (comp);
}
if (comp->hardware_addr.hlen)
hw_hash_add(comp);
comp->cltt = lease->cltt;
#if defined (FAILOVER_PROTOCOL)