s4-resolver: do not use all the A and AAAA records, those after a NS are not the...
authorMatthieu Patou <mat@matws.net>
Mon, 21 Nov 2011 22:37:03 +0000 (23:37 +0100)
committerMatthieu Patou <mat@matws.net>
Mon, 5 Dec 2011 17:23:08 +0000 (18:23 +0100)
source4/dsdb/repl/drepl_out_helpers.c
source4/libcli/resolve/dns_ex.c

index 8cfafb9527e43ad7ce3d7a29ec9b363a61ff2ebc..16825d400b52597e093a713e0b5ea8627ff665aa 100644 (file)
@@ -845,7 +845,7 @@ static void dreplsrv_update_refs_done(struct tevent_req *subreq)
                 * running production as this error otherwise never happen and
                 * due to the fact the send a DsReplicaUpdateRefs after each getNcChanges
                 */
-               if (!W_ERROR_EQUAL(werr, WERR_DS_DRA_BUSY)) {
+               if (!W_ERROR_EQUAL(r->out.result, WERR_DS_DRA_BUSY)) {
                        tevent_req_nterror(req, status);
                        return;
                }
index 20f2c0c03ae57cc1b221fedaa264d33f586c7fe6..9467521394efb2afa5f4b9dcd11e9ed1d69a03dc 100644 (file)
@@ -89,6 +89,14 @@ static uint32_t count_dns_rr(struct rk_resource_record *head, unsigned record_ty
                        continue;
                }
 
+               if (rr->type == rk_ns_t_ns) {
+                       /*
+                        * Record that will follow will be related to the NS
+                        * not what we are really interested with.
+                        * It's a good idea not to count them
+                        */
+                       break;
+               }
                /* we are only interested by requested record */
                if (rr->type != record_type) {
                        continue;
@@ -234,6 +242,14 @@ static struct dns_records_container get_a_aaaa_records(TALLOC_CTX *mem_ctx,
                                continue;
                        }
 
+                       if (rr->type == rk_ns_t_ns) {
+                               /*
+                                * After the record for NS will come the A or AAAA
+                                * record of the NS.
+                                */
+                               break;
+                       }
+
                        /* we are only interested in A and AAAA records */
                        if (rr->type != rk_ns_t_a && rr->type != rk_ns_t_aaaa) {
                                continue;