work on other platforms. Please report any problems and suggested fixes to
<dhcp-users@isc.org>.
-
Changes since 4.2.0a2
- Update the fsync code to work with the changes to the DDNS code. It now
uses a timer instead of noticing if there are no more packets to process.
+- When constructing the DNS name structure from a text string append
+ the root to relative names. This satisfies a requirement in the DNS
+ library that names be absolute instead of relative and prevents DHCP
+ from crashing. Bug ticket 21054.
+
Changes since 4.2.0a1
- When using 'ignore client-updates;', the FQDN returned to the client
return(result);
}
-/* Convert a string name into the proper structure for the isc routines */
+/*
+ * Convert a string name into the proper structure for the isc routines
+ *
+ * Previously we allowed names without a trailing '.' however the current
+ * dns and dst code requires the names to end in a period. If the
+ * name doesn't have a trailing period add one as part of creating
+ * the dns name.
+ */
+
isc_result_t
dhcp_isc_name(unsigned char *namestr,
dns_fixedname_t *namefix,
size_t namelen;
isc_buffer_t b;
isc_result_t result;
-
+
namelen = strlen((char *)namestr);
isc_buffer_init(&b, namestr, namelen);
isc_buffer_add(&b, namelen);
dns_fixedname_init(namefix);
*name = dns_fixedname_name(namefix);
- result = dns_name_fromtext(*name, &b, NULL, 0, NULL);
+ result = dns_name_fromtext(*name, &b, dns_rootname, 0, NULL);
isc_buffer_invalidate(&b);
return(result);
}
dns_name_t *name;
dns_fixedname_t name0;
isc_buffer_t b;
- int namelen;
isc_buffer_init(&b, secret, length);
isc_buffer_add(&b, length);
return(DHCP_R_INVALIDARG);
}
- /*
- * Previously we allowed key names without a trailing '.'
- * however the current dst code requires the names to end
- * in a period. If the name doesn't have a trailing period
- * add one before sending it to the dst code.
- */
- namelen = strlen(inname);
- if (inname[namelen-1] != '.') {
- char *newname = NULL;
- newname = (char *)dmalloc(namelen + 2, MDL);
- if (newname == NULL) {
- log_error("unable to allocate memory for key name");
- return(ISC_R_NOMEMORY);
- }
- strcpy(newname, inname);
- newname[namelen] = '.';
- newname[namelen+1] = 0;
- result = dhcp_isc_name((unsigned char *)newname, &name0, &name);
- dfree(newname, MDL);
- } else {
- result = dhcp_isc_name((unsigned char *)inname, &name0, &name);
- }
-
+ result = dhcp_isc_name((unsigned char *)inname, &name0, &name);
if (result != ISC_R_SUCCESS) {
return(result);
}