bind9/tests/dns
Matthijs Mekking ab8a0c4b5a and fix yet another dns_qp_lookup() iterator bug
This one is similar to the bug when searching for a key, reaching a
dead-end branch that doesn't match, because the branch offset point
is after the point where the search key differs.

This fixes the case where we are multiple levels deep. In other
words, we had a more-than-one matches *after* the point where the
search key differs.

For example, consider the following qp-trie:

branch: "[e]", "[m]":
 - leaf: "a.b.c.d.e"
 - branch: "moo[g]", "moo[k]", "moo[n]":
   - leaf: "moog"
   - branch: "mook[e]", "mook[o]"
     - leaf: "mooker"
     - leaf: "mooko"
   - leaf: "moon"

If searching for a key "monky", we would reach the branch with
twigs "moo[k]" and "moo[n]". The key matches on the 'k' on offset=4,
and reaches the branch with twigs "mook[e]" and "mook[o]". This time
we cannot find a twig that matches our key at offset=5, there is no
twig for 'y'. The closest name we found was "mooker".

Note that on a branch it can't detect it is on a dead branch because the
key is not encapsulated in a branch node.

In the previous code we considered "mooker" to be the successor of
"monky" and so we needed to the predecessor of "mooker" to find the
predecessor for "monky". However, since the search key alread differed
before entering this branch, this is not enough. We would be left with
"moog" as the predecessor of "monky", while in this example "a.b.c.d.e"
is the actual predecessor.

Instead, we need to go up a level, find the predecessor and check
again if we are on the right branch, and repeat the process until we
are.

Unit tests to cover the scenario are now added.
2023-12-11 21:01:29 +00:00
..
comparekeys Remove TKEY Mode 2 (Diffie-Hellman) 2023-03-08 08:36:25 +01:00
testdata Update "dns" unit test's test data .gitignore file 2022-08-09 08:19:51 +00:00
testkeys Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
.gitignore Add tests/dns/badcache.out to .gitignore 2023-10-27 12:55:51 +02:00
acl_test.c Refactor dns_{acl,aclenv}_create to return void 2023-10-13 14:44:40 +02:00
badcache_test.c remove dns_name_fromstring2() 2023-08-31 10:29:16 -07:00
db_test.c remove dns_name_fromstring2() 2023-08-31 10:29:16 -07:00
dbdiff_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
dbiterator_test.c clean up unused dns_db methods 2023-07-17 14:50:25 +02:00
dbversion_test.c clean up unused dns_db methods 2023-07-17 14:50:25 +02:00
dispatch_test.c Stream DNS: add PROXY over TLS support 2023-12-06 15:15:25 +02:00
dns64_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
dnstap_test.c remove dns_name_towire2() 2023-08-31 10:29:16 -07:00
dst_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
geoip_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
Kdh.+002+18602.key Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
keytable_test.c Attach to the dns_dispatchmgr in the dns_view object 2023-08-15 10:25:37 -07:00
Krsa.+008+29238.key Check if RSASHA1 is supported by the OS 2022-08-09 16:22:19 +02:00
Makefile.am add dns_nametree structure for policy match lookups 2023-09-01 10:46:48 -07:00
master_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
mkraw.pl Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
name_test.c remove dns_name_towire2() 2023-08-31 10:29:16 -07:00
nametree_test.c unconditionally create view and resolver nametrees 2023-09-04 10:19:48 +02:00
nsec3_test.c Change max NSEC3 iterations in unit tests to 50 2023-12-05 14:58:58 +00:00
nsec3param_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
private_test.c Update clang to version 14 2022-06-16 17:21:11 +02:00
qp_test.c and fix yet another dns_qp_lookup() iterator bug 2023-12-11 21:01:29 +00:00
qpmulti_test.c Improve qp-trie leaf return values 2023-08-15 14:24:39 +02:00
rbt_test.c Refactor isc_time_now() to return time, and not result 2023-03-31 15:02:06 +02:00
rbtdb_test.c Refactor the handling of isc_mem overmem condition 2023-11-29 14:16:20 +01:00
rdata_test.c Detect uncleared libcrypto errors in rdata processing 2023-09-01 12:01:20 +10:00
rdataset_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
rdatasetstats_test.c Refactor isc_stats_create() and its downstream users to return void 2023-07-27 11:37:44 +02:00
resolver_test.c Make dns_dispatch bound to threads 2023-09-16 07:32:17 +02:00
rsa_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
sigs_test.c remove dns_name_fromstring2() 2023-08-31 10:29:16 -07:00
time_test.c Move all the unit tests to /tests/<libname>/ 2022-05-28 14:53:02 -07:00
tsig_test.c Change dns_message_create() function to accept memory pools 2023-09-24 18:07:40 +02:00
update_test.c Remove isc_stdtime_get() macro 2023-03-31 13:33:16 +02:00
zonemgr_test.c Include <inttypes.h> whenever including <cmocka.h> 2023-05-18 15:12:23 +02:00
zt_test.c Add dns_view_apply 2023-06-01 16:51:38 +02:00