]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add query ID to the query trace message
authorColin Vidal <colin@isc.org>
Wed, 5 Nov 2025 14:06:03 +0000 (15:06 +0100)
committerColin Vidal <colin@isc.org>
Thu, 6 Nov 2025 14:11:45 +0000 (15:11 +0100)
Adding the query ID to the query trace message. The log is now as the
following (id is at the end):

    query client=0x7f75c5017000 thread=0x7f75c6dfe680(foo.fr/A): \
      client attr:0x22300, query attr:0x700, restarts:0, \
      origqname:foo.fr, timer:0, authdb:0, referral:0, id:21338

This should help debugging tests, in particular to quickly get a
specific query from the logs.

lib/ns/query.c

index 8733e0938de18a17a6a776763c8c0811da769fc9..3e7e37d56e5d3686df6a8ca6d9d05cc1bdbe523c 100644 (file)
@@ -5283,12 +5283,13 @@ query_trace(query_ctx_t *qctx) {
 
        snprintf(mbuf, sizeof(mbuf) - 1,
                 "client attr:0x%x, query attr:0x%X, restarts:%u, "
-                "origqname:%s, timer:%d, authdb:%d, referral:%d",
+                "origqname:%s, timer:%d, authdb:%d, referral:%d, id:%hu",
                 qctx->client->inner.attributes, qctx->client->query.attributes,
                 qctx->client->query.restarts, qbuf,
                 (int)qctx->client->query.timerset,
                 (int)qctx->client->query.authdbset,
-                (int)qctx->client->query.isreferral);
+                (int)qctx->client->query.isreferral,
+                qctx->client->message->id);
        CCTRACE(ISC_LOG_DEBUG(3), mbuf);
 #else  /* ifdef WANT_QUERYTRACE */
        UNUSED(qctx);