mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-28 12:57:42 +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:
parent
c62c07ef6a
commit
b8221d9512
5
RELNOTES
5
RELNOTES
@ -372,6 +372,11 @@ suggested fixes to <dhcp-users@isc.org>.
|
|||||||
- Encapsulated option spaces within encapsulated option spaces is now
|
- Encapsulated option spaces within encapsulated option spaces is now
|
||||||
formally supported.
|
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
|
Changes since 3.0.5
|
||||||
|
|
||||||
- Assorted fixes for broken network devices: Packet length is now
|
- Assorted fixes for broken network devices: Packet length is now
|
||||||
|
29
server/mdb.c
29
server/mdb.c
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@ -1064,8 +1064,6 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
|
|||||||
int propogate;
|
int propogate;
|
||||||
int pimmediate;
|
int pimmediate;
|
||||||
{
|
{
|
||||||
int enter_uid = 0;
|
|
||||||
int enter_hwaddr = 0;
|
|
||||||
struct lease *lp, **lq, *prev;
|
struct lease *lp, **lq, *prev;
|
||||||
TIME lp_next_state;
|
TIME lp_next_state;
|
||||||
#if defined (FAILOVER_PROTOCOL)
|
#if defined (FAILOVER_PROTOCOL)
|
||||||
@ -1115,26 +1113,19 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
|
|||||||
table and free it if necessary. */
|
table and free it if necessary. */
|
||||||
if (comp->uid) {
|
if (comp->uid) {
|
||||||
uid_hash_delete(comp);
|
uid_hash_delete(comp);
|
||||||
enter_uid = 1;
|
if (comp->uid != comp->uid_buf) {
|
||||||
if (comp -> uid != &comp -> uid_buf [0]) {
|
|
||||||
dfree(comp->uid, MDL);
|
dfree(comp->uid, MDL);
|
||||||
comp->uid_max = 0;
|
comp->uid_max = 0;
|
||||||
comp->uid_len = 0;
|
comp->uid_len = 0;
|
||||||
}
|
}
|
||||||
comp -> uid = (unsigned char *)0;
|
comp -> uid = (unsigned char *)0;
|
||||||
} else
|
}
|
||||||
enter_uid = 1;
|
|
||||||
|
|
||||||
if (comp -> hardware_addr.hlen &&
|
/* If there's a hardware address, remove the lease from its
|
||||||
((comp -> hardware_addr.hlen !=
|
* old position in the hash bucket's ordered list.
|
||||||
lease -> hardware_addr.hlen) ||
|
*/
|
||||||
memcmp (comp -> hardware_addr.hbuf,
|
if (comp->hardware_addr.hlen)
|
||||||
lease -> hardware_addr.hbuf,
|
|
||||||
comp -> hardware_addr.hlen))) {
|
|
||||||
hw_hash_delete(comp);
|
hw_hash_delete(comp);
|
||||||
enter_hwaddr = 1;
|
|
||||||
} else if (!comp -> hardware_addr.hlen)
|
|
||||||
enter_hwaddr = 1;
|
|
||||||
|
|
||||||
/* If the lease has been billed to a class, remove the billing. */
|
/* If the lease has been billed to a class, remove the billing. */
|
||||||
if (comp -> billing_class != lease -> billing_class) {
|
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. */
|
/* Record the lease in the uid hash if necessary. */
|
||||||
if (enter_uid && comp -> uid) {
|
if (comp->uid)
|
||||||
uid_hash_add(comp);
|
uid_hash_add(comp);
|
||||||
}
|
|
||||||
|
|
||||||
/* Record it in the hardware address hash if necessary. */
|
/* Record it in the hardware address hash if necessary. */
|
||||||
if (enter_hwaddr && lease -> hardware_addr.hlen) {
|
if (comp->hardware_addr.hlen)
|
||||||
hw_hash_add(comp);
|
hw_hash_add(comp);
|
||||||
}
|
|
||||||
|
|
||||||
comp->cltt = lease->cltt;
|
comp->cltt = lease->cltt;
|
||||||
#if defined (FAILOVER_PROTOCOL)
|
#if defined (FAILOVER_PROTOCOL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user