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]
This commit is contained in:
Mark Andrews 2014-05-29 08:04:55 +10:00
parent 3b5fc5809b
commit 5defbb76ea
4 changed files with 19 additions and 5 deletions

View file

@ -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.

View 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);

View file

@ -29,6 +29,7 @@ options {
listen-on { 10.53.0.5; };
listen-on-v6 { none; };
recursion yes;
querylog yes;
};
zone "." {

View file

@ -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