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

Minor code fixes

[ISC-Bugs #19566] When trying to find the zone for a name for ddns allow
 the name to be at the apex of the zone.
 [ISC-Bugs #19617] Restrict length of interface name read from command line
 in dhcpd - based on a patch from David Cantrell at Red Hat.
 [ISC-Bugs #20039] Correct some error messages in dhcpd.c
 [ISC-Bugs #20070] Better range check on values when creating a DHCID.
 [ISC-Bugs #20198] Avoid writing past the end of the field when adding
 overly long file or server names to a packet and add a log message
 if the configuration supplied overly long names for these fields.
 [ISC-Bugs #21497] Add a little more randomness to rng seed in client
This commit is contained in:
Shawn Routhier
2010-09-08 22:13:05 +00:00
parent ea75d5443c
commit 66be0ad13f
5 changed files with 58 additions and 16 deletions

View File

@@ -658,13 +658,16 @@ find_cached_zone(dhcp_ddns_cb_t *ddns_cb, int direction)
/*
* For each subzone, try to find a cached zone.
* Skip the first zone as that shouldn't work.
*/
for (np = strchr(np, '.'); np != NULL; np = strchr(np, '.')) {
np++;
for (;;) {
status = dns_zone_lookup (&zone, np);
if (status == ISC_R_SUCCESS)
break;
np = strchr(np, '.');
if (np == NULL)
break;
np++;
}
if (status != ISC_R_SUCCESS)
@@ -805,7 +808,11 @@ int get_dhcid (struct data_string *id,
id->buffer->data[0] = ISC_MD5_DIGESTLENGTH * 2 + 2;
/* Put the type in the next two bytes. */
id->buffer->data[1] = "0123456789abcdef"[type >> 4];
id->buffer->data[1] = "0123456789abcdef"[(type >> 4) & 0xf];
/* This should have been [type & 0xf] but now that
* it is in use we need to leave it this way in order
* to avoid disturbing customer's lease files
*/
id->buffer->data[2] = "0123456789abcdef"[type % 15];
/* Mash together an MD5 hash of the identifier. */