1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s4 dns: Handle CNAME records

This commit is contained in:
Kai Blin 2010-09-30 17:05:23 -07:00
parent 32a1b71ec8
commit 063727a88b

View File

@ -230,6 +230,21 @@ static NTSTATUS handle_question(struct dns_server *dns,
NT_STATUS_HAVE_NO_MEMORY(ans);
switch (question->question_type) {
case DNS_QTYPE_CNAME:
for (ri = 0; ri < el->num_values; ri++) {
if (recs[ri].wType != question->question_type) {
continue;
}
ZERO_STRUCT(ans[ai]);
ans[ai].name = talloc_strdup(ans, question->name);
ans[ai].rr_type = DNS_QTYPE_CNAME;
ans[ai].rr_class = DNS_QCLASS_IP;
ans[ai].ttl = recs[ri].dwTtlSeconds;
ans[ai].rdata.cname_record = talloc_strdup(ans, recs[ri].data.cname);
ai++;
}
break;
case DNS_QTYPE_A:
for (ri = 0; ri < el->num_values; ri++) {
if (recs[ri].wType != question->question_type) {