2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-03 15:56:00 +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

@@ -193,6 +193,8 @@ the README file.
incorrectly indicating 'up' state when any flags were set, rather than incorrectly indicating 'up' state when any flags were set, rather than
specifically the INTERFACE_REQUESTED flag. specifically the INTERFACE_REQUESTED flag.
- A reference leak on binding scopes set by ddns updates was repaired.
Changes since 3.0.5rc1 Changes since 3.0.5rc1
- A bug was repaired in fixes to the dhclient, which sought to run the - A bug was repaired in fixes to the dhclient, which sought to run the

View File

@@ -34,7 +34,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -399,7 +399,8 @@ int ddns_updates (struct packet *packet,
/* Now, install the DDNS data the new way. */ /* Now, install the DDNS data the new way. */
goto in; goto in;
} }
} } else
data_string_forget(&ddns_dhcid, MDL);
/* See if the administrator wants to do updates even /* See if the administrator wants to do updates even
in cases where the update already appears to have been in cases where the update already appears to have been
@@ -414,15 +415,12 @@ int ddns_updates (struct packet *packet,
result = 1; result = 1;
goto noerror; goto noerror;
} }
} /* If there's no "ddns-fwd-name" on the lease record, see if
* there's a ddns-client-fqdn indicating a previous client
/* If there's no ddns-fwd-name on the lease, see if there's * update (if it changes, we need to adjust the PTR).
a ddns-client-fqdn, indicating a prior client FQDN update. */
If there is, and if we're still doing the client update, } else if (find_bound_string(&old_ddns_fwd_name, lease->scope,
see if the name has changed. If it hasn't, don't do the "ddns-client-fqdn")) {
PTR update. */
if (find_bound_string (&old_ddns_fwd_name,
lease -> scope, "ddns-client-fqdn")) {
/* If the name is not different, no need to update /* If the name is not different, no need to update
the PTR record. */ the PTR record. */
if (old_ddns_fwd_name.len == ddns_fwd_name.len && 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 we are updating the A record, compute the DHCID value.
*/ */
if (server_updates_a) { if (server_updates_a) {
memset (&ddns_dhcid, 0, sizeof ddns_dhcid);
if (lease -> uid && lease -> uid_len) if (lease -> uid && lease -> uid_len)
result = get_dhcid (&ddns_dhcid, result = get_dhcid (&ddns_dhcid,
DHO_DHCP_CLIENT_IDENTIFIER, DHO_DHCP_CLIENT_IDENTIFIER,
@@ -563,7 +560,7 @@ int ddns_updates (struct packet *packet,
rcode1 = ddns_update_a (&ddns_fwd_name, lease -> ip_addr, rcode1 = ddns_update_a (&ddns_fwd_name, lease -> ip_addr,
&ddns_dhcid, ddns_ttl, 0, conflict); &ddns_dhcid, ddns_ttl, 0, conflict);
} }
if (rcode1 == ISC_R_SUCCESS) { if (rcode1 == ISC_R_SUCCESS) {
if (ddns_fwd_name.len && ddns_rev_name.len) if (ddns_fwd_name.len && ddns_rev_name.len)
rcode2 = ddns_update_ptr (&ddns_fwd_name, rcode2 = ddns_update_ptr (&ddns_fwd_name,