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:
15
common/dns.c
15
common/dns.c
@@ -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. */
|
||||
|
Reference in New Issue
Block a user