s4 dns: Allow updating PTR records.
[Samba/gebeck_regimport.git] / source4 / dns_server / dns_update.c
blob3473a70f55290c396a5b2822688e6d9539e32c44
1 /*
2 Unix SMB/CIFS implementation.
4 DNS server handler for update requests
6 Copyright (C) 2010 Kai Blin <kai@samba.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "includes.h"
23 #include "libcli/util/ntstatus.h"
24 #include "librpc/ndr/libndr.h"
25 #include "librpc/gen_ndr/ndr_dns.h"
26 #include "librpc/gen_ndr/ndr_dnsp.h"
27 #include <ldb.h>
28 #include "param/param.h"
29 #include "dsdb/samdb/samdb.h"
30 #include "dsdb/common/util.h"
31 #include "smbd/service_task.h"
32 #include "dns_server/dns_server.h"
33 #include "dns_server/dns_update.h"
35 static WERROR dns_rr_to_dnsp(TALLOC_CTX *mem_ctx,
36 const struct dns_res_rec *rrec,
37 struct dnsp_DnssrvRpcRecord *r);
39 static WERROR check_one_prerequisite(struct dns_server *dns,
40 TALLOC_CTX *mem_ctx,
41 const struct dns_name_question *zone,
42 const struct dns_res_rec *pr,
43 bool *final_result)
45 bool match;
46 WERROR werror;
47 struct ldb_dn *dn;
48 uint16_t i;
49 bool found = false;
50 struct dnsp_DnssrvRpcRecord *rec = NULL;
51 struct dnsp_DnssrvRpcRecord *ans;
52 uint16_t acount;
54 size_t host_part_len = 0;
56 *final_result = true;
58 if (pr->ttl != 0) {
59 return DNS_ERR(FORMAT_ERROR);
62 match = dns_name_match(zone->name, pr->name, &host_part_len);
63 if (!match) {
64 return DNS_ERR(NOTZONE);
67 werror = dns_name2dn(dns, mem_ctx, pr->name, &dn);
68 W_ERROR_NOT_OK_RETURN(werror);
70 if (pr->rr_class == DNS_QCLASS_ANY) {
72 if (pr->length != 0) {
73 return DNS_ERR(FORMAT_ERROR);
77 if (pr->rr_type == DNS_QTYPE_ALL) {
80 werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
81 W_ERROR_NOT_OK_RETURN(werror);
83 if (acount == 0) {
84 return DNS_ERR(NAME_ERROR);
86 } else {
89 werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
90 if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
91 return DNS_ERR(NXRRSET);
93 W_ERROR_NOT_OK_RETURN(werror);
95 for (i = 0; i < acount; i++) {
96 if (ans[i].wType == pr->rr_type) {
97 found = true;
98 break;
101 if (!found) {
102 return DNS_ERR(NXRRSET);
107 * RFC2136 3.2.5 doesn't actually mention the need to return
108 * OK here, but otherwise we'd always return a FORMAT_ERROR
109 * later on. This also matches Microsoft DNS behavior.
111 return WERR_OK;
114 if (pr->rr_class == DNS_QCLASS_NONE) {
115 if (pr->length != 0) {
116 return DNS_ERR(FORMAT_ERROR);
119 if (pr->rr_type == DNS_QTYPE_ALL) {
122 werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
123 if (W_ERROR_EQUAL(werror, WERR_OK)) {
124 return DNS_ERR(YXDOMAIN);
126 } else {
129 werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
130 if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
131 werror = WERR_OK;
132 ans = NULL;
133 acount = 0;
136 for (i = 0; i < acount; i++) {
137 if (ans[i].wType == pr->rr_type) {
138 found = true;
139 break;
142 if (found) {
143 return DNS_ERR(YXRRSET);
148 * RFC2136 3.2.5 doesn't actually mention the need to return
149 * OK here, but otherwise we'd always return a FORMAT_ERROR
150 * later on. This also matches Microsoft DNS behavior.
152 return WERR_OK;
155 if (pr->rr_class != zone->question_class) {
156 return DNS_ERR(FORMAT_ERROR);
159 *final_result = false;
161 werror = dns_lookup_records(dns, mem_ctx, dn, &ans, &acount);
162 if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
163 return DNS_ERR(NXRRSET);
165 W_ERROR_NOT_OK_RETURN(werror);
167 rec = talloc_zero(mem_ctx, struct dnsp_DnssrvRpcRecord);
168 W_ERROR_HAVE_NO_MEMORY(rec);
170 werror = dns_rr_to_dnsp(rec, pr, rec);
171 W_ERROR_NOT_OK_RETURN(werror);
173 for (i = 0; i < acount; i++) {
174 if (dns_records_match(rec, &ans[i])) {
175 found = true;
176 break;
180 if (!found) {
181 return DNS_ERR(NXRRSET);
184 return WERR_OK;
187 static WERROR check_prerequisites(struct dns_server *dns,
188 TALLOC_CTX *mem_ctx,
189 const struct dns_name_question *zone,
190 const struct dns_res_rec *prereqs, uint16_t count)
192 uint16_t i;
193 WERROR final_error = WERR_OK;
195 for (i = 0; i < count; i++) {
196 bool final;
197 WERROR werror;
199 werror = check_one_prerequisite(dns, mem_ctx, zone,
200 &prereqs[i], &final);
201 if (!W_ERROR_IS_OK(werror)) {
202 if (final) {
203 return werror;
205 if (W_ERROR_IS_OK(final_error)) {
206 final_error = werror;
211 if (!W_ERROR_IS_OK(final_error)) {
212 return final_error;
215 return WERR_OK;
218 static WERROR update_prescan(const struct dns_name_question *zone,
219 const struct dns_res_rec *updates, uint16_t count)
221 const struct dns_res_rec *r;
222 uint16_t i;
223 size_t host_part_len;
224 bool match;
226 for (i = 0; i < count; i++) {
227 r = &updates[i];
228 match = dns_name_match(zone->name, r->name, &host_part_len);
229 if (!match) {
230 return DNS_ERR(NOTZONE);
232 if (zone->question_class == r->rr_class) {
233 if (r->rr_type == DNS_QTYPE_ALL) {
234 return DNS_ERR(FORMAT_ERROR);
236 if (r->rr_type == DNS_QTYPE_AXFR) {
237 return DNS_ERR(FORMAT_ERROR);
239 if (r->rr_type == DNS_QTYPE_MAILB) {
240 return DNS_ERR(FORMAT_ERROR);
242 if (r->rr_type == DNS_QTYPE_MAILA) {
243 return DNS_ERR(FORMAT_ERROR);
245 } else if (r->rr_class == DNS_QCLASS_ANY) {
246 if (r->ttl != 0) {
247 return DNS_ERR(FORMAT_ERROR);
249 if (r->length != 0) {
250 return DNS_ERR(FORMAT_ERROR);
252 if (r->rr_type == DNS_QTYPE_AXFR) {
253 return DNS_ERR(FORMAT_ERROR);
255 if (r->rr_type == DNS_QTYPE_MAILB) {
256 return DNS_ERR(FORMAT_ERROR);
258 if (r->rr_type == DNS_QTYPE_MAILA) {
259 return DNS_ERR(FORMAT_ERROR);
261 } else if (r->rr_class == DNS_QCLASS_NONE) {
262 if (r->ttl != 0) {
263 return DNS_ERR(FORMAT_ERROR);
265 if (r->rr_type == DNS_QTYPE_ALL) {
266 return DNS_ERR(FORMAT_ERROR);
268 if (r->rr_type == DNS_QTYPE_AXFR) {
269 return DNS_ERR(FORMAT_ERROR);
271 if (r->rr_type == DNS_QTYPE_MAILB) {
272 return DNS_ERR(FORMAT_ERROR);
274 if (r->rr_type == DNS_QTYPE_MAILA) {
275 return DNS_ERR(FORMAT_ERROR);
277 } else {
278 return DNS_ERR(FORMAT_ERROR);
281 return WERR_OK;
284 static WERROR dns_rr_to_dnsp(TALLOC_CTX *mem_ctx,
285 const struct dns_res_rec *rrec,
286 struct dnsp_DnssrvRpcRecord *r)
288 char *tmp;
289 char *txt_record_txt;
290 char *saveptr = NULL;
292 if (rrec->rr_type == DNS_QTYPE_ALL) {
293 return DNS_ERR(FORMAT_ERROR);
296 ZERO_STRUCTP(r);
298 r->wType = rrec->rr_type;
299 r->dwTtlSeconds = rrec->ttl;
300 r->rank = DNS_RANK_ZONE;
301 /* TODO: Autogenerate this somehow */
302 r->dwSerial = 110;
304 /* If we get QCLASS_ANY, we're done here */
305 if (rrec->rr_class == DNS_QCLASS_ANY) {
306 goto done;
309 switch(rrec->rr_type) {
310 case DNS_QTYPE_A:
311 r->data.ipv4 = talloc_strdup(mem_ctx, rrec->rdata.ipv4_record);
312 W_ERROR_HAVE_NO_MEMORY(r->data.ipv4);
313 break;
314 case DNS_QTYPE_AAAA:
315 r->data.ipv6 = talloc_strdup(mem_ctx, rrec->rdata.ipv6_record);
316 W_ERROR_HAVE_NO_MEMORY(r->data.ipv6);
317 break;
318 case DNS_QTYPE_NS:
319 r->data.ns = talloc_strdup(mem_ctx, rrec->rdata.ns_record);
320 W_ERROR_HAVE_NO_MEMORY(r->data.ns);
321 break;
322 case DNS_QTYPE_CNAME:
323 r->data.cname = talloc_strdup(mem_ctx, rrec->rdata.cname_record);
324 W_ERROR_HAVE_NO_MEMORY(r->data.cname);
325 break;
326 case DNS_QTYPE_SRV:
327 r->data.srv.wPriority = rrec->rdata.srv_record.priority;
328 r->data.srv.wWeight = rrec->rdata.srv_record.weight;
329 r->data.srv.wPort = rrec->rdata.srv_record.port;
330 r->data.srv.nameTarget = talloc_strdup(mem_ctx,
331 rrec->rdata.srv_record.target);
332 W_ERROR_HAVE_NO_MEMORY(r->data.srv.nameTarget);
333 break;
334 case DNS_QTYPE_PTR:
335 r->data.ptr = talloc_strdup(mem_ctx, rrec->rdata.ptr_record);
336 W_ERROR_HAVE_NO_MEMORY(r->data.ptr);
337 break;
338 case DNS_QTYPE_MX:
339 r->data.mx.wPriority = rrec->rdata.mx_record.preference;
340 r->data.mx.nameTarget = talloc_strdup(mem_ctx,
341 rrec->rdata.mx_record.exchange);
342 W_ERROR_HAVE_NO_MEMORY(r->data.mx.nameTarget);
343 break;
344 case DNS_QTYPE_TXT:
345 r->data.txt.count = 0;
346 r->data.txt.str = talloc_array(mem_ctx, const char *,
347 r->data.txt.count);
348 W_ERROR_HAVE_NO_MEMORY(r->data.txt.str);
350 txt_record_txt = talloc_strdup(r->data.txt.str,
351 rrec->rdata.txt_record.txt);
352 W_ERROR_HAVE_NO_MEMORY(txt_record_txt);
354 tmp = strtok_r(txt_record_txt, "\"", &saveptr);
355 while (tmp) {
356 if (strcmp(tmp, " ") == 0) {
357 tmp = strtok_r(NULL, "\"", &saveptr);
358 continue;
360 r->data.txt.str = talloc_realloc(mem_ctx, r->data.txt.str, const char *,
361 r->data.txt.count+1);
362 r->data.txt.str[r->data.txt.count] = talloc_strdup(r->data.txt.str, tmp);
363 W_ERROR_HAVE_NO_MEMORY(r->data.txt.str[r->data.txt.count]);
365 r->data.txt.count++;
366 tmp = strtok_r(NULL, "\"", &saveptr);
369 break;
370 default:
371 DEBUG(0, ("Got a qytpe of %d\n", rrec->rr_type));
372 return DNS_ERR(NOT_IMPLEMENTED);
375 done:
377 return WERR_OK;
381 static WERROR handle_one_update(struct dns_server *dns,
382 TALLOC_CTX *mem_ctx,
383 const struct dns_name_question *zone,
384 const struct dns_res_rec *update)
386 struct dnsp_DnssrvRpcRecord *recs = NULL;
387 uint16_t rcount = 0;
388 struct ldb_dn *dn;
389 uint16_t i;
390 WERROR werror;
391 bool needs_add = false;
393 DEBUG(2, ("Looking at record: \n"));
394 if (DEBUGLVL(2)) {
395 NDR_PRINT_DEBUG(dns_res_rec, discard_const(update));
398 switch (update->rr_type) {
399 case DNS_QTYPE_A:
400 break;
401 case DNS_QTYPE_NS:
402 break;
403 case DNS_QTYPE_CNAME:
404 break;
405 case DNS_QTYPE_SOA:
406 break;
407 case DNS_QTYPE_PTR:
408 break;
409 case DNS_QTYPE_MX:
410 break;
411 case DNS_QTYPE_AAAA:
412 break;
413 case DNS_QTYPE_SRV:
414 break;
415 case DNS_QTYPE_TXT:
416 break;
417 default:
418 DEBUG(0, ("Can't handle updates of type %u yet\n",
419 update->rr_type));
420 return DNS_ERR(NOT_IMPLEMENTED);
423 werror = dns_name2dn(dns, mem_ctx, update->name, &dn);
424 W_ERROR_NOT_OK_RETURN(werror);
426 werror = dns_lookup_records(dns, mem_ctx, dn, &recs, &rcount);
427 if (W_ERROR_EQUAL(werror, DNS_ERR(NAME_ERROR))) {
428 recs = NULL;
429 rcount = 0;
430 needs_add = true;
431 werror = WERR_OK;
433 W_ERROR_NOT_OK_RETURN(werror);
435 if (update->rr_class == zone->question_class) {
436 if (update->rr_type == DNS_QTYPE_CNAME) {
438 * If there is a record in the directory
439 * that's not a CNAME, ignore update
441 for (i = 0; i < rcount; i++) {
442 if (recs[i].wType != DNS_TYPE_CNAME) {
443 DEBUG(0, ("Skipping update\n"));
444 return WERR_OK;
446 break;
450 * There should be no entries besides one CNAME record
451 * per name, so replace everything with the new CNAME
454 rcount = 1;
455 recs = talloc_realloc(mem_ctx, recs,
456 struct dnsp_DnssrvRpcRecord, rcount);
457 W_ERROR_HAVE_NO_MEMORY(recs);
459 werror = dns_rr_to_dnsp(recs, update, &recs[0]);
460 W_ERROR_NOT_OK_RETURN(werror);
462 werror = dns_replace_records(dns, mem_ctx, dn,
463 needs_add, recs, rcount);
464 W_ERROR_NOT_OK_RETURN(werror);
466 return WERR_OK;
467 } else {
469 * If there is a CNAME record for this name,
470 * ignore update
472 for (i = 0; i < rcount; i++) {
473 if (recs[i].wType == DNS_TYPE_CNAME) {
474 DEBUG(0, ("Skipping update\n"));
475 return WERR_OK;
479 if (update->rr_type == DNS_QTYPE_SOA) {
480 bool found = false;
483 * If the zone has no SOA record?? or update's
484 * serial number is smaller than existing SOA's,
485 * ignore update
487 for (i = 0; i < rcount; i++) {
488 if (recs[i].wType == DNS_TYPE_SOA) {
489 uint16_t n, o;
491 n = update->rdata.soa_record.serial;
492 o = recs[i].data.soa.serial;
494 * TODO: Implement RFC 1982 comparison
495 * logic for RFC2136
497 if (n <= o) {
498 DEBUG(0, ("Skipping update\n"));
499 return WERR_OK;
501 found = true;
502 break;
505 if (!found) {
506 DEBUG(0, ("Skipping update\n"));
507 return WERR_OK;
510 werror = dns_rr_to_dnsp(mem_ctx, update, &recs[i]);
511 W_ERROR_NOT_OK_RETURN(werror);
513 for (i++; i < rcount; i++) {
514 if (recs[i].wType != DNS_TYPE_SOA) {
515 continue;
518 ZERO_STRUCT(recs[i]);
521 werror = dns_replace_records(dns, mem_ctx, dn,
522 needs_add, recs, rcount);
523 W_ERROR_NOT_OK_RETURN(werror);
525 return WERR_OK;
528 recs = talloc_realloc(mem_ctx, recs,
529 struct dnsp_DnssrvRpcRecord, rcount+1);
530 W_ERROR_HAVE_NO_MEMORY(recs);
532 werror = dns_rr_to_dnsp(recs, update, &recs[rcount]);
533 W_ERROR_NOT_OK_RETURN(werror);
535 for (i = 0; i < rcount; i++) {
536 if (!dns_records_match(&recs[i], &recs[rcount])) {
537 continue;
540 recs[i] = recs[rcount];
542 werror = dns_replace_records(dns, mem_ctx, dn,
543 needs_add, recs, rcount);
544 W_ERROR_NOT_OK_RETURN(werror);
546 return WERR_OK;
549 werror = dns_replace_records(dns, mem_ctx, dn,
550 needs_add, recs, rcount+1);
551 W_ERROR_NOT_OK_RETURN(werror);
553 return WERR_OK;
554 } else if (update->rr_class == DNS_QCLASS_ANY) {
555 if (update->rr_type == DNS_QTYPE_ALL) {
556 if (dns_name_equal(update->name, zone->name)) {
557 for (i = 0; i < rcount; i++) {
559 if (recs[i].wType == DNS_TYPE_SOA) {
560 continue;
563 if (recs[i].wType == DNS_TYPE_NS) {
564 continue;
567 ZERO_STRUCT(recs[i]);
570 } else {
571 for (i = 0; i < rcount; i++) {
572 ZERO_STRUCT(recs[i]);
576 } else if (dns_name_equal(update->name, zone->name)) {
578 if (update->rr_type == DNS_QTYPE_SOA) {
579 return WERR_OK;
582 if (update->rr_type == DNS_QTYPE_NS) {
583 return WERR_OK;
586 for (i = 0; i < rcount; i++) {
587 if (recs[i].wType == update->rr_type) {
588 ZERO_STRUCT(recs[i]);
592 werror = dns_replace_records(dns, mem_ctx, dn,
593 needs_add, recs, rcount);
594 W_ERROR_NOT_OK_RETURN(werror);
596 return WERR_OK;
597 } else if (update->rr_class == DNS_QCLASS_NONE) {
598 struct dnsp_DnssrvRpcRecord *del_rec;
600 if (update->rr_type == DNS_QTYPE_SOA) {
601 return WERR_OK;
603 if (update->rr_type == DNS_QTYPE_NS) {
604 bool found = false;
605 struct dnsp_DnssrvRpcRecord *ns_rec = talloc(mem_ctx,
606 struct dnsp_DnssrvRpcRecord);
607 W_ERROR_HAVE_NO_MEMORY(ns_rec);
610 werror = dns_rr_to_dnsp(ns_rec, update, ns_rec);
611 W_ERROR_NOT_OK_RETURN(werror);
613 for (i = 0; i < rcount; i++) {
614 if (dns_records_match(ns_rec, &recs[i])) {
615 found = true;
616 break;
619 if (found) {
620 return WERR_OK;
624 del_rec = talloc(mem_ctx, struct dnsp_DnssrvRpcRecord);
625 W_ERROR_HAVE_NO_MEMORY(del_rec);
627 werror = dns_rr_to_dnsp(del_rec, update, del_rec);
628 W_ERROR_NOT_OK_RETURN(werror);
630 for (i = 0; i < rcount; i++) {
631 if (dns_records_match(del_rec, &recs[i])) {
632 ZERO_STRUCT(recs[i]);
636 werror = dns_replace_records(dns, mem_ctx, dn,
637 needs_add, recs, rcount);
638 W_ERROR_NOT_OK_RETURN(werror);
641 return WERR_OK;
644 static WERROR handle_updates(struct dns_server *dns,
645 TALLOC_CTX *mem_ctx,
646 const struct dns_name_question *zone,
647 const struct dns_res_rec *prereqs, uint16_t pcount,
648 struct dns_res_rec *updates, uint16_t upd_count)
650 struct ldb_dn *zone_dn = NULL;
651 WERROR werror = WERR_OK;
652 int ret;
653 uint16_t ri;
654 TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
656 werror = dns_name2dn(dns, tmp_ctx, zone->name, &zone_dn);
657 W_ERROR_NOT_OK_RETURN(werror);
659 ret = ldb_transaction_start(dns->samdb);
660 if (ret != LDB_SUCCESS) {
661 return DNS_ERR(SERVER_FAILURE);
664 werror = check_prerequisites(dns, tmp_ctx, zone, prereqs, pcount);
665 W_ERROR_NOT_OK_GOTO(werror, failed);
667 DEBUG(0, ("update count is %u\n", upd_count));
669 for (ri = 0; ri < upd_count; ri++) {
670 werror = handle_one_update(dns, tmp_ctx, zone,
671 &updates[ri]);
672 W_ERROR_NOT_OK_GOTO(werror, failed);
675 ldb_transaction_commit(dns->samdb);
676 TALLOC_FREE(tmp_ctx);
677 return WERR_OK;
679 failed:
680 ldb_transaction_cancel(dns->samdb);
681 TALLOC_FREE(tmp_ctx);
682 return werror;
686 WERROR dns_server_process_update(struct dns_server *dns,
687 struct dns_request_state *state,
688 TALLOC_CTX *mem_ctx,
689 struct dns_name_packet *in,
690 struct dns_res_rec **prereqs, uint16_t *prereq_count,
691 struct dns_res_rec **updates, uint16_t *update_count,
692 struct dns_res_rec **additional, uint16_t *arcount)
694 struct dns_name_question *zone;
695 const struct dns_server_zone *z;
696 size_t host_part_len = 0;
697 WERROR werror = DNS_ERR(NOT_IMPLEMENTED);
699 if (in->qdcount != 1) {
700 return DNS_ERR(FORMAT_ERROR);
703 zone = &in->questions[0];
705 if (zone->question_class != DNS_QCLASS_IN &&
706 zone->question_class != DNS_QCLASS_ANY) {
707 return DNS_ERR(NOT_IMPLEMENTED);
710 if (zone->question_type != DNS_QTYPE_SOA) {
711 return DNS_ERR(FORMAT_ERROR);
714 DEBUG(2, ("Got a dns update request.\n"));
716 for (z = dns->zones; z != NULL; z = z->next) {
717 bool match;
719 match = dns_name_match(z->name, zone->name, &host_part_len);
720 if (match) {
721 break;
725 if (z == NULL) {
726 DEBUG(0, ("We're not authorative for this zone\n"));
727 return DNS_ERR(NOTAUTH);
730 if (host_part_len != 0) {
731 /* TODO: We need to delegate this one */
732 DEBUG(0, ("Would have to delegate zones.\n"));
733 return DNS_ERR(NOT_IMPLEMENTED);
736 *prereq_count = in->ancount;
737 *prereqs = in->answers;
738 werror = check_prerequisites(dns, mem_ctx, in->questions, *prereqs,
739 *prereq_count);
740 W_ERROR_NOT_OK_RETURN(werror);
742 /* TODO: Check if update is allowed, we probably want "always",
743 * key-based GSSAPI, key-based bind-style TSIG and "never" as
744 * smb.conf options. */
745 if (lpcfg_allow_dns_updates(dns->task->lp_ctx) != DNS_UPDATE_ON) {
746 DEBUG(0, ("Update not allowed.\n"));
747 return DNS_ERR(REFUSED);
750 *update_count = in->nscount;
751 *updates = in->nsrecs;
752 werror = update_prescan(in->questions, *updates, *update_count);
753 W_ERROR_NOT_OK_RETURN(werror);
756 werror = handle_updates(dns, mem_ctx, in->questions, *prereqs,
757 *prereq_count, *updates, *update_count);
758 W_ERROR_NOT_OK_RETURN(werror);
760 return werror;