From 225146b2c8c7de8dcff979841b56b15aef8aded2 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 18 Nov 2013 11:22:59 +1100 Subject: [PATCH] 3674. [bug] RPZ zeroed ttls if the query type was '*'. [RT #35026] --- CHANGES | 2 ++ bin/named/query.c | 1 + bin/tests/system/rpz/tests.sh | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index a9ff663e60..5e612ae781 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3674. [bug] RPZ zeroed ttls if the query type was '*'. [RT #35026] + 3673. [func] New "in-view" zone option allows direct sharing of zones between views. [RT #32968] diff --git a/bin/named/query.c b/bin/named/query.c index bb652022f3..fb0259732a 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -4904,6 +4904,7 @@ rpz_rewrite(ns_client_t *client, dns_rdatatype_t qtype, isc_result_t qresult, memset(&st->m, 0, sizeof(st->m)); st->m.type = DNS_RPZ_TYPE_BAD; st->m.policy = DNS_RPZ_POLICY_MISS; + st->m.ttl = ~0; memset(&st->r, 0, sizeof(st->r)); memset(&st->q, 0, sizeof(st->q)); dns_fixedname_init(&st->_p_namef); diff --git a/bin/tests/system/rpz/tests.sh b/bin/tests/system/rpz/tests.sh index 85017723f3..03a0aad3ac 100644 --- a/bin/tests/system/rpz/tests.sh +++ b/bin/tests/system/rpz/tests.sh @@ -555,5 +555,10 @@ if test -n "$EMSGS"; then egrep 'invalid rpz|rpz.*failed' ns*/named.run | sed -e '10,$d' -e 's/^/I: /' fi +echo "I:checking that ttl values are not zeroed when qtype is '*'" +$DIG +noall +answer -p 5300 @$ns3 any a3-2.tld2 > dig.out.any +ttl=`awk '/a3-2 tld2 text/ {print $2}' dig.out.any` +if test ${ttl:=0} -eq 0; then setret I:failed; fi + echo "I:exit status: $status" exit $status