]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2130. [func] Log if CD or DO were set. [RT #16640]
authorMark Andrews <marka@isc.org>
Tue, 6 Feb 2007 04:00:21 +0000 (04:00 +0000)
committerMark Andrews <marka@isc.org>
Tue, 6 Feb 2007 04:00:21 +0000 (04:00 +0000)
CHANGES
bin/named/query.c
doc/arm/Bv9ARM-book.xml

diff --git a/CHANGES b/CHANGES
index bc36ef13a02ea354b05c1887f405e01e7c157abb..a0c88d627fbf736d8cc49f055ab0d19940a98e28 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2130.  [func]          Log if CD or DO were set. [RT #16640]
+
 2129.  [func]          Provide a pool of UDP sockets for queries to be
                        made over. See use-queryport-pool, queryport-pool-ports
                        and queryport-pool-updateinterval.  [RT #16415]
index 4b7a36cf4eac83023eb92ebfb38ee1d0a54d6c52..6156d555efb7af18d8b0f36d1fd195e6c5510a49 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.292 2007/01/08 02:45:04 marka Exp $ */
+/* $Id: query.c,v 1.293 2007/02/06 04:00:21 marka Exp $ */
 
 /*! \file */
 
@@ -4388,7 +4388,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
 }
 
 static inline void
-log_query(ns_client_t *client) {
+log_query(ns_client_t *client, unsigned int flags, unsigned int extflags) {
        char namebuf[DNS_NAME_FORMATSIZE];
        char typename[DNS_RDATATYPE_FORMATSIZE];
        char classname[DNS_RDATACLASS_FORMATSIZE];
@@ -4405,10 +4405,12 @@ log_query(ns_client_t *client) {
        dns_rdatatype_format(rdataset->type, typename, sizeof(typename));
 
        ns_client_log(client, NS_LOGCATEGORY_QUERIES, NS_LOGMODULE_QUERY,
-                     level, "query: %s %s %s %s%s%s", namebuf, classname,
+                     level, "query: %s %s %s %s%s%s%s%s", namebuf, classname,
                      typename, WANTRECURSION(client) ? "+" : "-",
                      (client->signer != NULL) ? "S": "",
-                     (client->opt != NULL) ? "E" : "");
+                     (client->opt != NULL) ? "E" : "",
+                     ((extflags & DNS_MESSAGEEXTFLAG_DO) != 0) ? "D" : "",
+                     ((flags & DNS_MESSAGEFLAG_CD) != 0) ? "C" : "");
 }
 
 void
@@ -4418,6 +4420,8 @@ ns_query_start(ns_client_t *client) {
        dns_rdataset_t *rdataset;
        ns_client_t *qclient;
        dns_rdatatype_t qtype;
+       unsigned int saved_extflags = client->extflags;
+       unsigned int saved_flags = client->message->flags;
 
        CTRACE("ns_query_start");
 
@@ -4490,7 +4494,7 @@ ns_query_start(ns_client_t *client) {
        }
 
        if (ns_g_server->log_queries)
-               log_query(client);
+               log_query(client, saved_flags, saved_extflags);
 
        /*
         * Check for multiple question queries, since edns1 is dead.
index 7a806cda4114b40c99666dd663343b3043f2589f..19d2c2b980d78ee475651329bb84d0a9a8360ac8 100644 (file)
@@ -18,7 +18,7 @@
  - PERFORMANCE OF THIS SOFTWARE.
 -->
 
-<!-- File: $Id: Bv9ARM-book.xml,v 1.313 2007/02/02 02:18:05 marka Exp $ -->
+<!-- File: $Id: Bv9ARM-book.xml,v 1.314 2007/02/06 04:00:21 marka Exp $ -->
 <book xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>BIND 9 Administrator Reference Manual</title>
 
@@ -4200,15 +4200,18 @@ category notify { null; };
                       enable query logging unless <command>querylog</command> option has been
                       specified.
                     </para>
-                    <para>
-                      The query log entry reports the client's IP address and
-                      port number, and the
-                      query name, class and type.  It also reports whether the
-                      Recursion Desired
-                      flag was set (+ if set, - if not set), EDNS was in use
-                      (E) or if the
-                      query was signed (S).
-                    </para>
+
+                   <para>
+                     the query log entry reports the client's IP
+                     address and port number, and the query name,
+                     class and type.  It also reports whether the
+                     Recursion Desired flag was set (+ if set, -
+                     if not set), if the query was signed (S),
+                     EDNS was in use (E), if DO (DNSSSEC ok) was
+                     set (D), or if CD (checking disabled) was set
+                     (C).
+                   </para>
+
                     <para>
                       <computeroutput>client 127.0.0.1#62536: query: www.example.com IN AAAA +SE</computeroutput>
                     </para>