From: Volker Lendecke Date: Sat, 1 Aug 2015 15:59:14 +0000 (+0200) Subject: dns_server: Fix CNAME handling X-Git-Tag: talloc-2.1.4~470 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c48dbde06ac7d0c3cea52401ddf78e604e02b83;p=thirdparty%2Fsamba.git dns_server: Fix CNAME handling 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 Reviewed-by: Ira Cooper Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Tue Aug 4 13:41:17 CEST 2015 on sn-devel-104 --- diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c index de0a4339a55..3cafc23cd41 100644 --- a/source4/dns_server/dns_query.c +++ b/source4/dns_server/dns_query.c @@ -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;