Source: nsd
Version: 4.1.0-2
Severity: normal
Tags: patch upstream fixed-upstream

Hello,

I reported a bug in nsd upstream and a fix is already committed. Would
be nice to get this into Debian, too.

My report can be found in the nsd-users mailing list archive at
http://open.nlnetlabs.nl/pipermail/nsd-users/2015-January/002056.html
Assuming this link will work for some time, I don't repeat the details
here. The intention is that nsd sends the same reply as bind for CNAME
RRs that are generated from usage of DNAME in a zone.

The following patch cherry-picks the source changes from upstream's svn
repository, revision 4382. I dropped some binary changes which I think
are related to automatic testing, only.

Best regards
Uwe

---->8----
From: W.C.A. Wijngaards <[email protected]>
Date: 2015-01-21 09:36:06
Subject: Synthesize CNAMEs with same TTL as DNAME

Origin: upstream, r4382
--- a/query.c
+++ b/query.c
@@ -703,7 +703,7 @@
 static size_t
 query_synthesize_cname(struct query* q, struct answer* answer, const 
dname_type* from_name,
        const dname_type* to_name, domain_type* src, domain_type* 
to_closest_encloser,
-       domain_type** to_closest_match)
+       domain_type** to_closest_match, uint32_t ttl)
 {
        /* add temporary domains for from_name and to_name and all
           their (not allocated yet) parents */
@@ -765,7 +765,7 @@
        rrset->rrs = (rr_type*) region_alloc(q->region, sizeof(rr_type));
        memset(rrset->rrs, 0, sizeof(rr_type));
        rrset->rrs->owner = cname_domain;
-       rrset->rrs->ttl = 0;
+       rrset->rrs->ttl = ttl;
        rrset->rrs->type = TYPE_CNAME;
        rrset->rrs->klass = CLASS_IN;
        rrset->rrs->rdata_count = 1;
@@ -1020,7 +1020,7 @@
                        exact = namedb_lookup(nsd->db, newname, &closest_match, 
&closest_encloser);
                        /* synthesize CNAME record */
                        newnum = query_synthesize_cname(q, answer, name, 
newname,
-                               src, closest_encloser, &closest_match);
+                               src, closest_encloser, &closest_match, 
rrset->rrs[0].ttl);
                        if(!newnum) {
                                /* could not synthesize the CNAME. */
                                /* return previous CNAMEs to make resolver 
recurse for us */
---




-- System Information:
Debian Release: 8.0
  APT prefers testing-proposed-updates
  APT policy: (900, 'testing-proposed-updates'), (900, 'testing'), (600, 
'unstable'), (500, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to