mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-28 12:57:42 +00:00
-n [master]
[rt26311] Fix the issue with DDNS by checking to see if we have added a pointer to the ddns_cb and skipping the cache threshold check if we did. Also expand and correct the cache threshold check into the delayed ack code.
This commit is contained in:
parent
ad4001ce80
commit
8cd88e202b
4
RELNOTES
4
RELNOTES
@ -47,6 +47,10 @@ work on other platforms. Please report any problems and suggested fixes to
|
|||||||
than extend or renew the lease. This absolves the server of needing
|
than extend or renew the lease. This absolves the server of needing
|
||||||
to perform an fsync() operation on the lease database before reply,
|
to perform an fsync() operation on the lease database before reply,
|
||||||
which improves performance. [ISC-Bugs #22228]
|
which improves performance. [ISC-Bugs #22228]
|
||||||
|
Update this patch to support asynchronous DDNS. If the server is
|
||||||
|
attempting to do DDNS on a lease it should be udpated and written to
|
||||||
|
disk even if that wouldn't be necessary due to the thresholding
|
||||||
|
[ISC-Bugs #26311]
|
||||||
|
|
||||||
- The 'no available billing' log line now also logs the name of the last
|
- The 'no available billing' log line now also logs the name of the last
|
||||||
matching billing class tried before failing to provide a billing.
|
matching billing class tried before failing to provide a billing.
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
Find and identify the network interfaces. */
|
Find and identify the network interfaces. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2013 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
* Copyright (c) 2004-2009,2011 by Internet Systems Consortium, Inc. ("ISC")
|
* Copyright (c) 2004-2009,2011 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
* Copyright (c) 1995-2003 by Internet Software Consortium
|
* Copyright (c) 1995-2003 by Internet Software Consortium
|
||||||
*
|
*
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
DHCP Protocol engine. */
|
DHCP Protocol engine. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004-2012 by Internet Systems Consortium, Inc. ("ISC")
|
* Copyright (c) 2004-2013 by Internet Systems Consortium, Inc. ("ISC")
|
||||||
* Copyright (c) 1995-2003 by Internet Software Consortium
|
* Copyright (c) 1995-2003 by Internet Software Consortium
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
@ -1561,7 +1561,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
|
|||||||
TIME remaining_time;
|
TIME remaining_time;
|
||||||
struct iaddr cip;
|
struct iaddr cip;
|
||||||
#if defined(DELAYED_ACK)
|
#if defined(DELAYED_ACK)
|
||||||
isc_boolean_t enqueue = ISC_TRUE;
|
/* By default we don't do the enqueue */
|
||||||
|
isc_boolean_t enqueue = ISC_FALSE;
|
||||||
#endif
|
#endif
|
||||||
int use_old_lease = 0;
|
int use_old_lease = 0;
|
||||||
|
|
||||||
@ -2541,7 +2542,14 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
|
|||||||
data_string_forget(&d1, MDL);
|
data_string_forget(&d1, MDL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((thresh > 0) && (offer == DHCPACK) &&
|
/*
|
||||||
|
* We check on ddns_cb to see if the ddns code has
|
||||||
|
* updated the lt structure. We could probably simply
|
||||||
|
* copy the ddns_cb pointer in that case but lets be
|
||||||
|
* simple and safe and update the entire lease.
|
||||||
|
*/
|
||||||
|
if ((lt->ddns_cb == NULL) &&
|
||||||
|
(thresh > 0) && (offer == DHCPACK) &&
|
||||||
(lease->binding_state == FTS_ACTIVE)) {
|
(lease->binding_state == FTS_ACTIVE)) {
|
||||||
int limit;
|
int limit;
|
||||||
int prev_lease = lease->ends - lease->starts;
|
int prev_lease = lease->ends - lease->starts;
|
||||||
@ -2569,18 +2577,16 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
|
|||||||
* the same lease to another client later, and that would be
|
* the same lease to another client later, and that would be
|
||||||
* a conflict.
|
* a conflict.
|
||||||
*/
|
*/
|
||||||
if (!use_old_lease && !supersede_lease(lease, lt, commit,
|
if ((use_old_lease == 0) &&
|
||||||
|
!supersede_lease(lease, lt, commit,
|
||||||
offer == DHCPACK, offer == DHCPACK)) {
|
offer == DHCPACK, offer == DHCPACK)) {
|
||||||
#else /* defined(DELAYED_ACK) */
|
#else /* defined(DELAYED_ACK) */
|
||||||
/*
|
/*
|
||||||
* If there already isn't a need for a lease commit, and we
|
* If there already isn't a need for a lease commit, and we
|
||||||
* can just answer right away, set a flag to indicate this.
|
* can just answer right away, set a flag to indicate this.
|
||||||
*/
|
*/
|
||||||
if (commit && !(lease->flags & STATIC_LEASE) &&
|
if (commit)
|
||||||
(!offer || (offer == DHCPACK)))
|
|
||||||
enqueue = ISC_TRUE;
|
enqueue = ISC_TRUE;
|
||||||
else
|
|
||||||
enqueue = ISC_FALSE;
|
|
||||||
|
|
||||||
/* Install the new information on 'lt' onto the lease at
|
/* Install the new information on 'lt' onto the lease at
|
||||||
* 'lease'. We will not 'commit' this information to disk
|
* 'lease'. We will not 'commit' this information to disk
|
||||||
@ -2591,8 +2597,9 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
|
|||||||
* BOOTREPLY either); we may give the same lease out to a
|
* BOOTREPLY either); we may give the same lease out to a
|
||||||
* different client, and that would be a conflict.
|
* different client, and that would be a conflict.
|
||||||
*/
|
*/
|
||||||
if (!supersede_lease(lease, lt, 0, !offer || offer == DHCPACK,
|
if ((use_old_lease == 0) &&
|
||||||
0)) {
|
!supersede_lease(lease, lt, 0,
|
||||||
|
!offer || offer == DHCPACK, 0)) {
|
||||||
#endif
|
#endif
|
||||||
log_info ("%s: database update failed", msg);
|
log_info ("%s: database update failed", msg);
|
||||||
free_lease_state (state, MDL);
|
free_lease_state (state, MDL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user