dns: Use new DNS debugclass in DNS server
[kai/samba.git] / source4 / dns_server / dns_query.c
index 98ebc63d97f13be73674f62a84a79b9a59e21dea..4ad14b9a558810e07f2590d66df762fc5545ecd8 100644 (file)
@@ -37,6 +37,9 @@
 #include "auth/credentials/credentials.h"
 #include "auth/gensec/gensec.h"
 
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_DNS
+
 static WERROR create_response_rr(const struct dns_name_question *question,
                                 const struct dnsp_DnssrvRpcRecord *rec,
                                 struct dns_res_rec **answers, uint16_t *ancount)
@@ -89,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);
@@ -509,7 +520,7 @@ static WERROR handle_tkey(struct dns_server *dns,
                                return WERR_NOMEM;
                        }
                } else {
-                       DEBUG(0, ("GSS key negotiation returned %s\n", nt_errstr(status)));
+                       DEBUG(1, ("GSS key negotiation returned %s\n", nt_errstr(status)));
                        ret_tkey->rdata.tkey_record.error = DNS_RCODE_BADKEY;
                }