]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix bugs in 'reclimit/ans2' and 'reclimit/ans4' servers stepan/reclimit-asyncserver 11822/head
authorŠtěpán Balážik <stepan@isc.org>
Thu, 9 Apr 2026 00:19:33 +0000 (02:19 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Thu, 9 Apr 2026 00:59:38 +0000 (02:59 +0200)
There were multiple weird/non-standard behaviors.

bin/tests/system/reclimit/ans2/ans.py
bin/tests/system/reclimit/reclimit_ans.py

index 25847c21b769a01188e9387a36badb0e2b9af7d0..7f1f7804b6e43fafc235ea4cb37a58e34bff2b42 100644 (file)
@@ -52,22 +52,10 @@ class Ns1ExampleNetHandler(ReclimitHandler):
                     f"ns1.{target_ns_number}.example.net.",
                 )
             )
-
-        # XXX: Perl version truncates the responses at 512 bytes to force NS explosion on non-IPv6 builds.
-        #      Mimic this to have packet-for-packet compatibility, but remove before merge as non-IPv6 builds
-        #      are no longer a thing, I think.
-        for offset in range(1, 16):
-            target_ns_number = next_ns_block_start + offset
             qctx.response.additional.append(
                 a(f"ns1.{target_ns_number}.example.net.", 7)
             )
 
-            # You would think that this was incorrect and end up with one A record over the 512 byte limit,
-            # but thats's not the case, because Perl's DNS library has more agressive name compression than dnspython,
-            # so this ends up working out.
-            if len(qctx.response.to_wire()) > 512:
-                break
-
         yield DnsResponseSend(qctx.response, authoritative=False)
 
 
index b08d5f164ffddc0309cad50075d58a7446e443fd..77426dcb89abe90d82deeb89970672acfd314396 100644 (file)
@@ -241,11 +241,6 @@ class Ns1ExampleOrgHandler(ReclimitHandler):
             if qctx.qtype == dns.rdatatype.A:
                 qctx.response.answer.append(a(qctx.qname, 4))
 
-            # XXX: The original Perl implementation doesn't set AA on empty responses,
-            #      let's do the same for packet-for-packet compatibility and drop it later.
-            elif qctx.qtype == dns.rdatatype.AAAA:
-                qctx.response.flags &= ~dns.flags.AA
-
         if qctx.qname in self._waiting_responses_locks:
             # Second query arrived, release the first response.
             self._waiting_responses_locks[qctx.qname].release()