]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Fix IPv6-outgoing-only zero-scope ECS test
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 10 Jun 2020 08:20:06 +0000 (10:20 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 3 Jul 2020 08:25:08 +0000 (10:25 +0200)
The recursor uses the outgoing address family to set the ECS address to
a localhost address when a client indicates that it wants no ECS (by
setting the all-zero scope).

Now that we _actually_ do v6-only outgoing when requested by configuration,
we need the regression test auths to listen on v6.

This change to the regression tests makes the ROOT auth listen on
[::1]:53, adds the hints, and for the ECS test, starts an IPv6 ECS
echo responder on [::1]:53000 and uses that address for the
forward-zone.

regression-tests.recursor-dnssec/recursortests.py
regression-tests.recursor-dnssec/test_ECS.py

index 83322a86a7cf09415576d39ff6639afa5f3ba141..a9189810383750190c1e3dc6d075c129890c76a4 100644 (file)
@@ -50,6 +50,7 @@ log-common-errors=yes
     _roothints = """
 .                        3600 IN NS  ns.root.
 ns.root.                 3600 IN A   %s.8
+ns.root.                 3600 IN AAAA ::1
 """ % _PREFIX
     _root_DS = "63149 13 1 a59da3f5c1b97fcd5fa2b3b2b0ac91d38a60d33a"
 
@@ -498,7 +499,10 @@ distributor-threads={threads}""".format(confdir=confdir,
         authcmd = list(cls._auth_cmd)
         authcmd.append('--config-dir=%s' % confdir)
         authcmd.append('--local-address=%s' % ipaddress)
-        authcmd.append('--local-ipv6=')
+        if (confdir[-4:] == "ROOT"):
+            authcmd.append('--local-ipv6=::1')
+        else:
+            authcmd.append('--local-ipv6=')
         print(' '.join(authcmd))
 
         logFile = os.path.join(confdir, 'pdns.log')
index 9c9e6581a9db9358628b044bef226806c467225b..a4bdfffd20003a7c17b18e427776a02cd377a34f 100644 (file)
@@ -14,6 +14,7 @@ nameECS = 'ecs-echo.example.'
 nameECSInvalidScope = 'invalid-scope.ecs-echo.example.'
 ttlECS = 60
 ecsReactorRunning = False
+ecsReactorv6Running = False
 
 class ECSTest(RecursorTest):
     _config_template_default = """
@@ -62,6 +63,7 @@ disable-syslog=yes
     @classmethod
     def startResponders(cls):
         global ecsReactorRunning
+        global ecsReactorv6Running
         print("Launching responders..")
 
         address = cls._PREFIX + '.21'
@@ -71,6 +73,10 @@ disable-syslog=yes
             reactor.listenUDP(port, UDPECSResponder(), interface=address)
             ecsReactorRunning = True
 
+        if not ecsReactorv6Running:
+            reactor.listenUDP(53000, UDPECSResponder(), interface='::1')
+            ecsReactorv6Running = True
+
         if not reactor.running:
             cls._UDPResponder = threading.Thread(name='UDP Responder', target=reactor.run, args=(False,))
             cls._UDPResponder.setDaemon(True)
@@ -349,8 +355,9 @@ use-incoming-edns-subnet=yes
 ecs-ipv6-bits=128
 ecs-ipv4-cache-bits=32
 ecs-ipv6-cache-bits=128
-forward-zones=ecs-echo.example=%s.21
-    """ % (os.environ['PREFIX'])
+query-local-address=::1
+forward-zones=ecs-echo.example=[::1]:53000
+    """
 
     def testSendECS(self):
         expected = dns.rrset.from_text(nameECS, ttlECS, dns.rdataclass.IN, 'TXT', '2001:db8::1/128')