s4 dns: the opcode is called OPCODE_UPDATE in the RFC, not OPCODE_REGISTER
[garming/samba-autobuild/.git] / source4 / dns_server / dns_server.c
index de8bc125420936cfae7ea9200f0abb6ac0ef4ddc..899ec0c1ad177297c317e3f44fbf6105235dabb9 100644 (file)
@@ -144,7 +144,7 @@ static NTSTATUS dns_process(struct dns_server *dns,
                                               &additional, &num_additional);
 
                break;
-       case DNS_OPCODE_REGISTER:
+       case DNS_OPCODE_UPDATE:
                ret = dns_server_process_update(dns, out_packet, in_packet,
                                                answers, num_answers,
                                                &nsrecs,  &num_nsrecs,
@@ -490,7 +490,7 @@ static NTSTATUS dns_add_socket(struct dns_server *dns,
                                                address, port,
                                                &dns_socket->local_address);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                return status;
        }
 
@@ -519,7 +519,7 @@ static NTSTATUS dns_add_socket(struct dns_server *dns,
                                     dns_udp_socket,
                                     &dns_udp_socket->dgram);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                DEBUG(0,("Failed to bind to %s:%u UDP - %s\n",
                         address, port, nt_errstr(status)));
                return status;
@@ -601,7 +601,6 @@ static void dns_task_init(struct task_server *task)
        struct interface *ifaces;
        int ret;
        struct ldb_result *res;
-       struct ldb_dn *rootdn;
        static const char * const attrs[] = { "name", NULL};
        unsigned int i;
 
@@ -641,14 +640,8 @@ static void dns_task_init(struct task_server *task)
                return;
        }
 
-       rootdn = ldb_dn_new(dns, dns->samdb, "");
-       if (rootdn == NULL) {
-               task_server_terminate(task, "dns: out of memory", true);
-               return;
-       }
-
        // TODO: this search does not work against windows
-       ret = dsdb_search(dns->samdb, dns, &res, rootdn, LDB_SCOPE_SUBTREE,
+       ret = dsdb_search(dns->samdb, dns, &res, NULL, LDB_SCOPE_SUBTREE,
                          attrs, DSDB_SEARCH_SEARCH_ALL_PARTITIONS, "(objectClass=dnsZone)");
        if (ret != LDB_SUCCESS) {
                task_server_terminate(task,