diff options
author | Kai Blin <kai@samba.org> | 2012-12-10 05:50:05 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-05-16 21:40:35 +1000 |
commit | 4364a3faf64fc9a022bc8870e2817573b94a4d0c (patch) | |
tree | 1e62254b01a6df7f826e3750dcfb5dbf029d8789 /source4/dns_server | |
parent | 2e9cf99bcef81d5e0b25221956a79e5f2fee1bf0 (diff) | |
download | samba-4364a3faf64fc9a022bc8870e2817573b94a4d0c.tar.gz samba-4364a3faf64fc9a022bc8870e2817573b94a4d0c.tar.bz2 samba-4364a3faf64fc9a022bc8870e2817573b94a4d0c.zip |
dns: Add support for MX queries
Due to an oversight, the internal DNS server supports MX record updates,
but not MX record queries. Add support for MX queries and tests.
This should fix bug #9485
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'source4/dns_server')
-rw-r--r-- | source4/dns_server/dns_query.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/dns_server/dns_query.c b/source4/dns_server/dns_query.c index 35921100e1..4ad14b9a55 100644 --- a/source4/dns_server/dns_query.c +++ b/source4/dns_server/dns_query.c @@ -92,6 +92,14 @@ static WERROR create_response_rr(const struct dns_name_question *question, case DNS_QTYPE_PTR: ans[ai].rdata.ptr_record = talloc_strdup(ans, rec->data.ptr); break; + case DNS_QTYPE_MX: + ans[ai].rdata.mx_record.preference = rec->data.mx.wPriority; + ans[ai].rdata.mx_record.exchange = talloc_strdup( + ans, rec->data.mx.nameTarget); + if (ans[ai].rdata.mx_record.exchange == NULL) { + return WERR_NOMEM; + } + break; case DNS_QTYPE_TXT: tmp = talloc_asprintf(ans, "\"%s\"", rec->data.txt.str[0]); W_ERROR_HAVE_NO_MEMORY(tmp); |