Add a test case for fix_iterator hang

When fixing the iterator, when every leaf on this branch is greater
than the one we wanted we go back to the parent branch and iterate back
to the predecessor from that point.

But if there are no more previous leafs, it means the queried name
precedes the entire range of names in the database, so we would just
move the iterator one step back and continue from there.

This could end in a loop because the queried name precedes the entire
range of names and so none of those names are the predecessor of the
queried name.
This commit is contained in:
Matthijs Mekking
2024-03-19 09:45:59 +01:00
parent 948a89d591
commit 2a724a808d

View File

@@ -777,6 +777,7 @@ ISC_RUN_TEST_IMPL(fixiterator) {
"private-dnskey.dynamic.",
"rrsig.dynamic.",
"txt.dynamic.",
"trailing.",
"" };
int i = 0;
@@ -786,9 +787,11 @@ ISC_RUN_TEST_IMPL(fixiterator) {
}
static struct check_predecessors check1[] = {
{ "newtext.dynamic.", "mx.dynamic.", DNS_R_PARTIALMATCH, 6 },
{ "absent.", "txt.dynamic.", ISC_R_NOTFOUND, 0 },
{ "nonexistent.", "txt.dynamic.", ISC_R_NOTFOUND, 0 },
{ "newtext.dynamic.", "mx.dynamic.", DNS_R_PARTIALMATCH, 7 },
{ "d.", "trailing.", ISC_R_NOTFOUND, 0 },
{ "absent.", "trailing.", ISC_R_NOTFOUND, 0 },
{ "nonexistent.", "txt.dynamic.", ISC_R_NOTFOUND, 1 },
{ "wayback.", "trailing.", ISC_R_NOTFOUND, 0 },
{ NULL, NULL, 0, 0 }
};