dns_server: Fix CNAME handling
authorVolker Lendecke <vl@samba.org>
Sat, 1 Aug 2015 15:59:14 +0000 (17:59 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 4 Aug 2015 11:41:17 +0000 (13:41 +0200)
recs[i].wtype is == DNS_TYPE_CNAME, and my understanding of the union is that
data.cname is filled. We get away with this, because ipv4 and ipv6 have the
same char * representation, but it's confusing.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Aug  4 13:41:17 CEST 2015 on sn-devel-104

source4/dns_server/dns_query.c

index de0a4339a55d604c9e3bb90bfeedc0709f069127..3cafc23cd415a2eabff71a85027142beb401ed0d 100644 (file)
@@ -309,11 +309,7 @@ static WERROR handle_question(struct dns_server *dns,
                        /* First build up the new question */
                        new_q->question_type = question->question_type;
                        new_q->question_class = question->question_class;
-                       if (new_q->question_type == DNS_QTYPE_A) {
-                               new_q->name = talloc_strdup(new_q, recs[ri].data.ipv4);
-                       } else if (new_q->question_type == DNS_QTYPE_AAAA) {
-                               new_q->name = talloc_strdup(new_q, recs[ri].data.ipv6);
-                       }
+                       new_q->name = talloc_strdup(new_q, recs[ri].data.cname);
                        if (new_q->name == NULL) {
                                TALLOC_FREE(new_q);
                                return WERR_NOMEM;