mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-29 13:28:14 +00:00
- Do not delay-ack STATIC leases.
- Use lease referencers to maintain reference count on the lease structure. - Log an error if you encounter a lease with no transmit-state. o These changes were to a feature that has not yet been publically released, so there is no RELNOTES entry.
This commit is contained in:
parent
b05a07d048
commit
087b8f18ad
@ -2813,7 +2813,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
|
|||||||
++outstanding_pings;
|
++outstanding_pings;
|
||||||
} else {
|
} else {
|
||||||
lease->cltt = cur_time;
|
lease->cltt = cur_time;
|
||||||
if (!offer || (offer == DHCPACK))
|
if (!(lease->flags & STATIC_LEASE) &&
|
||||||
|
(!offer || (offer == DHCPACK)))
|
||||||
delayed_ack_enqueue(lease);
|
delayed_ack_enqueue(lease);
|
||||||
else
|
else
|
||||||
dhcp_reply(lease);
|
dhcp_reply(lease);
|
||||||
@ -2844,7 +2845,7 @@ delayed_ack_enqueue(struct lease *lease)
|
|||||||
}
|
}
|
||||||
memset(q, 0, sizeof *q);
|
memset(q, 0, sizeof *q);
|
||||||
/* prepend to ackqueue*/
|
/* prepend to ackqueue*/
|
||||||
q->lease = lease;
|
lease_reference(&q->lease, lease, MDL);
|
||||||
q->next = ackqueue_head;
|
q->next = ackqueue_head;
|
||||||
ackqueue_head = q;
|
ackqueue_head = q;
|
||||||
if (!ackqueue_tail)
|
if (!ackqueue_tail)
|
||||||
@ -2884,7 +2885,15 @@ flush_ackqueue(void *foo)
|
|||||||
/* process from bottom to retain packet order */
|
/* process from bottom to retain packet order */
|
||||||
for (ack = ackqueue_tail ; ack ; ack = p) {
|
for (ack = ackqueue_tail ; ack ; ack = p) {
|
||||||
p = ack->prev;
|
p = ack->prev;
|
||||||
dhcp_reply(ack->lease);
|
|
||||||
|
/* dhcp_reply() requires that the reply state still be valid */
|
||||||
|
if (ack->lease->state == NULL)
|
||||||
|
log_error("delayed ack for %s has gone stale",
|
||||||
|
piaddr(ack->lease->ip_addr));
|
||||||
|
else
|
||||||
|
dhcp_reply(ack->lease);
|
||||||
|
|
||||||
|
lease_dereference(&ack->lease, MDL);
|
||||||
ack->next = free_ackqueue;
|
ack->next = free_ackqueue;
|
||||||
free_ackqueue = ack;
|
free_ackqueue = ack;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user