]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3863. [bug] The "E" flag was missing from the query log as a
authorMark Andrews <marka@isc.org>
Wed, 28 May 2014 22:04:55 +0000 (08:04 +1000)
committerMark Andrews <marka@isc.org>
Wed, 28 May 2014 22:05:39 +0000 (08:05 +1000)
                        unintended side effect of code rearrangement to
                        support EDNS EXPIRE. [RT #36117]

CHANGES
bin/named/query.c
bin/tests/system/resolver/ns5/named.conf
bin/tests/system/resolver/tests.sh

diff --git a/CHANGES b/CHANGES
index 8745cb46459e98ccfdb9e180b5b39fc7da0573ef..f7ee8272b804df78d31ebade40d7cad22fc53870 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3863.  [bug]           The "E" flag was missing from the query log as a
+                       unintended side effect of code rearrangement to
+                       support EDNS EXPIRE. [RT #36117]
+
 3862.  [cleanup]       Return immediately if we are not going to log the
                        message in ns_client_dumpmessage.
 
index 01ef572044973adca1320a251ebdcb96354179bb..4f932104920889df68ac08a7808b97d0972bd940 100644 (file)
@@ -8111,8 +8111,8 @@ log_query(ns_client_t *client, unsigned int flags, unsigned int extflags) {
        ns_client_log(client, NS_LOGCATEGORY_QUERIES, NS_LOGMODULE_QUERY,
                      level, "query: %s %s %s %s%s%s%s%s%s (%s)", namebuf,
                      classname, typename, WANTRECURSION(client) ? "+" : "-",
-                     (client->signer != NULL) ? "S": "",
-                     (client->opt != NULL) ? "E" : "",
+                     (client->signer != NULL) ? "S" : "",
+                     (client->ednsversion >= 0) ? "E" : "",
                      ((client->attributes & NS_CLIENTATTR_TCP) != 0) ?
                                 "T" : "",
                      ((extflags & DNS_MESSAGEEXTFLAG_DO) != 0) ? "D" : "",
@@ -8191,8 +8191,6 @@ ns_query_start(ns_client_t *client) {
        if (!client->view->enablednssec) {
                message->flags &= ~DNS_MESSAGEFLAG_CD;
                client->extflags &= ~DNS_MESSAGEEXTFLAG_DO;
-               if (client->opt != NULL)
-                       client->opt->ttl &= ~DNS_MESSAGEEXTFLAG_DO;
        }
 
        if ((message->flags & DNS_MESSAGEFLAG_RD) != 0)
@@ -8304,7 +8302,7 @@ ns_query_start(ns_client_t *client) {
        /*
         * Turn on minimal responses for EDNS/UDP bufsize 512 queries.
         */
-       if (client->opt != NULL && client->udpsize <= 512U &&
+       if (client->ednsversion >= 0 && client->udpsize <= 512U &&
            (client->attributes & NS_CLIENTATTR_TCP) == 0)
                client->query.attributes |= (NS_QUERYATTR_NOAUTHORITY |
                                             NS_QUERYATTR_NOADDITIONAL);
index af8d073d567bafb482a19cc2a405da4484f29ce7..120d0fa4812a849be8c271d1f538f82dcb71c7c3 100644 (file)
@@ -29,6 +29,7 @@ options {
        listen-on { 10.53.0.5; };
        listen-on-v6 { none; };
        recursion yes;
+       querylog yes;
 };
 
 zone "." {
index 075c49d61262182e6be86a2be8970455e4851d59..324119b142655b481675a3e29a8e137989bcca89 100755 (executable)
@@ -475,5 +475,16 @@ $DIG @10.53.0.5 -p 5300 fetchall.tld any > dig.out.3.${n} || ret=1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo "I:check that E was logged on EDNS queries in the query log (${n})"
+ret=0
+grep "query: fetchall.tld IN ANY +E" ns5/named.run > /dev/null || ret=1
+$DIG @10.53.0.5 -p 5300 +noedns noedns.fetchall.tld any > dig.out.2.${n} || ret=1
+grep "query: noedns.fetchall.tld IN ANY" ns5/named.run > /dev/null || ret=1
+grep "query: noedns.fetchall.tld IN ANY +E" ns5/named.run > /dev/null && ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+
 echo "I:exit status: $status"
 exit $status