]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Provide an early escape hatch for ns_client_transport_type
authorAydın Mercan <aydin@isc.org>
Thu, 15 Feb 2024 10:30:42 +0000 (13:30 +0300)
committerAydın Mercan <aydin@isc.org>
Fri, 26 Apr 2024 13:12:29 +0000 (16:12 +0300)
Because some tests don't have a legtimate handle, provide a temporary
return early that should be fixed and removed before squashing. This
short circuiting is still correct until DoQ/DoH3 support is introduced.

lib/ns/client.c

index 04447397af79b169411771fc2e4ef3ac8f8d6037..f6ccdd0c5bd6e4659441b5c09119cacbde7cafc9 100644 (file)
@@ -123,9 +123,19 @@ static void
 compute_cookie(ns_client_t *client, uint32_t when, const unsigned char *secret,
               isc_buffer_t *buf);
 
+#ifdef HAVE_DNSTAP
 static dns_transport_type_t
 ns_client_transport_type(const ns_client_t *client) {
-       REQUIRE(client->handle != NULL);
+       /*
+        * Early escape hatch for libtest/ns.c
+        *
+        * When DoQ support this had to be removed to get correct DoQ entries.
+        */
+       if (!TCP_CLIENT(client)) {
+               return DNS_TRANSPORT_UDP;
+       }
+
+       INSIST(client->handle != NULL);
 
        switch (isc_nm_socket_type(client->handle)) {
        case isc_nm_udpsocket:
@@ -158,6 +168,7 @@ ns_client_transport_type(const ns_client_t *client) {
 
        return DNS_TRANSPORT_UDP;
 }
+#endif /* HAVE_DNSTAP */
 
 void
 ns_client_recursing(ns_client_t *client) {