mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
allow undedication of the dedicated buffer
This commit is contained in:
@@ -254,12 +254,16 @@ dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer);
|
|||||||
* The caller must not write to buffer until the name has been
|
* The caller must not write to buffer until the name has been
|
||||||
* invalidated or is otherwise known not to be in use.
|
* invalidated or is otherwise known not to be in use.
|
||||||
*
|
*
|
||||||
|
* If buffer is NULL and the name previously had a dedicated buffer,
|
||||||
|
* than that buffer is no longer dedicated to use with this name.
|
||||||
|
* The caller is responsible for ensuring that the storage used by
|
||||||
|
* the name remains valid.
|
||||||
|
*
|
||||||
* Requires:
|
* Requires:
|
||||||
* 'name' is a valid name.
|
* 'name' is a valid name.
|
||||||
*
|
*
|
||||||
* 'name' doesn't have a dedicated buffer already.
|
* 'buffer' is a valid binary buffer and 'name' doesn't have a
|
||||||
*
|
* dedicated buffer already, or 'buffer' is NULL.
|
||||||
* 'buffer' is a valid binary buffer.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_boolean_t
|
isc_boolean_t
|
||||||
|
@@ -289,8 +289,10 @@ dns_name_setbuffer(dns_name_t *name, isc_buffer_t *buffer) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
REQUIRE(VALID_NAME(name));
|
REQUIRE(VALID_NAME(name));
|
||||||
REQUIRE(name->buffer == NULL);
|
REQUIRE((buffer != NULL &&
|
||||||
REQUIRE(isc_buffer_type(buffer) == ISC_BUFFERTYPE_BINARY);
|
name->buffer == NULL &&
|
||||||
|
isc_buffer_type(buffer) == ISC_BUFFERTYPE_BINARY) ||
|
||||||
|
(buffer == NULL));
|
||||||
|
|
||||||
name->buffer = buffer;
|
name->buffer = buffer;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user