]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add a test case for fix_iterator hang
authorMatthijs Mekking <matthijs@isc.org>
Tue, 19 Mar 2024 08:45:59 +0000 (09:45 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Mon, 25 Mar 2024 09:40:23 +0000 (10:40 +0100)
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.

tests/dns/qp_test.c

index b9c3afcc5f139f08b2cf9f246ef9cb4fc144c92c..7dc0f68c2aada43141f873ee6bc75acbc1bf406a 100644 (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 }
        };