mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
simplify dns_name_fromtext() interface
previously, dns_name_fromtext() took both a target name and an optional target buffer parameter, which could override the name's dedicated buffer. this interface is unnecessarily complex. we now have two functions, dns_name_fromtext() to convert text into a dns_name that has a dedicated buffer, and dns_name_wirefromtext() to convert text into uncompressed DNS wire format and append it to a target buffer. in cases where it really is necessary to have both, we can use dns_name_fromtext() to load the dns_name, then dns_name_towire() to append the wire format to the target buffer.
This commit is contained in:
@@ -80,5 +80,5 @@ dns_byaddr_createptrname(const isc_netaddr_t *address, dns_name_t *name) {
|
||||
len = (unsigned int)strlen(textname);
|
||||
isc_buffer_init(&buffer, textname, len);
|
||||
isc_buffer_add(&buffer, len);
|
||||
return dns_name_fromtext(name, &buffer, dns_rootname, 0, NULL);
|
||||
return dns_name_fromtext(name, &buffer, dns_rootname, 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user