comply with [MS-DFSC] section 3.2.1.1
Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
uint32_t count;
};
+static void shuffle_dc_set(struct dc_set *list)
+{
+ uint32_t i;
+
+ srandom(time(NULL));
+
+ for (i = list->count; i > 1; i--) {
+ uint32_t r;
+ const char *tmp;
+
+ r = random() % i;
+
+ tmp = list->names[i - 1];
+ list->names[i - 1] = list->names[r];
+ list->names[r] = tmp;
+ }
+}
+
/*
fill a referral type structure
*/
talloc_free(msg);
}
+ shuffle_dc_set(list);
+
talloc_free(r);
return NT_STATUS_OK;
}