2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

- A reference leak on binding scopes set by ddns updates was repaired.

[ISC-Bugs #16769]
This commit is contained in:
David Hankins
2007-03-27 02:47:27 +00:00
parent c57db45ce9
commit 75ab3070cc
2 changed files with 12 additions and 13 deletions

View File

@@ -34,7 +34,7 @@
#ifndef lint
static char copyright[] =
"$Id: ddns.c,v 1.23 2006/08/02 22:36:00 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
"$Id: ddns.c,v 1.24 2007/03/27 02:47:27 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -399,7 +399,8 @@ int ddns_updates (struct packet *packet,
/* Now, install the DDNS data the new way. */
goto in;
}
}
} else
data_string_forget(&ddns_dhcid, MDL);
/* See if the administrator wants to do updates even
in cases where the update already appears to have been
@@ -414,15 +415,12 @@ int ddns_updates (struct packet *packet,
result = 1;
goto noerror;
}
}
/* If there's no ddns-fwd-name on the lease, see if there's
a ddns-client-fqdn, indicating a prior client FQDN update.
If there is, and if we're still doing the client update,
see if the name has changed. If it hasn't, don't do the
PTR update. */
if (find_bound_string (&old_ddns_fwd_name,
lease -> scope, "ddns-client-fqdn")) {
/* If there's no "ddns-fwd-name" on the lease record, see if
* there's a ddns-client-fqdn indicating a previous client
* update (if it changes, we need to adjust the PTR).
*/
} else if (find_bound_string(&old_ddns_fwd_name, lease->scope,
"ddns-client-fqdn")) {
/* If the name is not different, no need to update
the PTR record. */
if (old_ddns_fwd_name.len == ddns_fwd_name.len &&
@@ -520,7 +518,6 @@ int ddns_updates (struct packet *packet,
* If we are updating the A record, compute the DHCID value.
*/
if (server_updates_a) {
memset (&ddns_dhcid, 0, sizeof ddns_dhcid);
if (lease -> uid && lease -> uid_len)
result = get_dhcid (&ddns_dhcid,
DHO_DHCP_CLIENT_IDENTIFIER,
@@ -563,7 +560,7 @@ int ddns_updates (struct packet *packet,
rcode1 = ddns_update_a (&ddns_fwd_name, lease -> ip_addr,
&ddns_dhcid, ddns_ttl, 0, conflict);
}
if (rcode1 == ISC_R_SUCCESS) {
if (ddns_fwd_name.len && ddns_rev_name.len)
rcode2 = ddns_update_ptr (&ddns_fwd_name,