sucky in the past couple of months. The nerve.
Anyway, dns_name_split now correctly compacts the preceding bitstring label
(if any) when a maximal bitstring is split.
It also correctly creates the suffix when a maximal bitstring is split.
It was doing this incorrectly before, independent of the compaction issue.
labels, zeroing a few of the least signficant bits in
the prefix part. When such an improperly created
prefix was returned to the RBT database, the bogus
label was dutifully stored, corrupting the tree.
[RT #369]
Also made dns_name_split() REQUIRE that suffixlabels always be greater than 0,
even when splitting a bitstring label (it already required this when not
splitting a bitstring label). This is consistent with the way dns_name_split()
was called to split a name that consisted of a single label, a bitstring;
the appropriate suffixlabels value is 1 in such cases.
Also a fixed minor style error, and a confusing comment.
hidden behind #ifdef's, since no OPT code number has yet to be assigned
by the IANA. They are also not quite complete in all regards; VIEW
options are understood and ignored. ZONE options are understood and
acted upon, though some of the error cases aren't quite right.
Remove doubled isc_mem_stats in dighost.c
Update todo list.
Change literal 255's to DNS_NAME_MAXWIRE in name.c
that is simpler, faster, and produces a much more even distribution,
particularly when the data to hash ends with a null byte like domain
names often do
Mostly, several functions that take pointers as arguments, almost
always char * pointers, had those pointers qualified with "const".
Those that returned pointers to previously const-qualified arguments
had their return values qualified as const. Some structure members
were qualified as const to retain that attribute from the variables
from which they were assigned.
The macro DE_CONST is used to deal with a handful of very special
places where something is qualified as const but really needs to have
its const qualifier removed.
rdata.c now defines macros for the prototypes of the basic rdata functions,
and all of the lib/dns/rdata/**/*.c files now use them.
Some minor integer-compatibility issues. (IE, ~0x03 is a signed int,
so assigning it to an unsigned int should use a cast. The type of an
enum member is int, so there are some conversion issues there, too.)
A pointers-to-function should not be cast to a pointer-to-object.
Variables should not be named for C reserved identifiers.
One or two set-but-not-used variables removed.
Minor other ISC style cleanups.
isc_buffer_remaininglength of 0. this finds problems like isc_buffer_init
not followed by isc_buffer_add much sooner.
also, enforce the already documented contract requirements of needing
a valid source buffer and either a valid target buffer or a name
with a dedicated buffer.
Cleanup of redundant/useless header file inclusion.
ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
/*
* This is a comment.
*/
Added:
isc_buffer_base(b) (pointer)
isc_buffer_current(b) (pointer)
isc_buffer_active(b) (pointer)
isc_buffer_used(b) (pointer)
isc_buffer_length(b) (int)
isc_buffer_usedlength(b) (int)
isc_buffer_consumedlength(b) (int)
isc_buffer_remaininglength(b) (int)
isc_buffer_activelength(b) (int)
isc_buffer_availablelength(b) (int)
Removed:
ISC_BUFFER_USEDCOUNT(b)
ISC_BUFFER_AVAILABLECOUNT(b)
isc_buffer_type(b)
Changed names:
isc_buffer_used(b, r) ->
isc_buffer_usedregion(b, r)
isc_buffer_available(b, r) ->
isc_buffer_available_region(b, r)
isc_buffer_consumed(b, r) ->
isc_buffer_consumedregion(b, r)
isc_buffer_active(b, r) ->
isc_buffer_activeregion(b, r)
isc_buffer_remaining(b, r) ->
isc_buffer_remainingregion(b, r)
Buffer types were removed, so the ISC_BUFFERTYPE_*
macros are no more, and the type argument to
isc_buffer_init and isc_buffer_allocate were removed.
isc_buffer_putstr is now void (instead of isc_result_t)
and requires that the caller ensure that there
is enough available buffer space for the string.