+/**
+ * Shuffle answers
+ * Fisher-Yates (aka Knuth) Shuffle
+ *
+ * @param request context for the request (with answers)
+ */
+static void
+shuffle_answers (struct Request *request)
+{
+ unsigned int idx = request->packet->num_answers;
+ unsigned int r_idx;
+ struct GNUNET_DNSPARSER_Record tmp_answer;
+
+ while (0 != idx)
+ {
+ r_idx = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
+ request->packet->num_answers);
+ idx--;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Swapping %u with %u\n", idx, r_idx);
+ tmp_answer = request->packet->answers[idx];
+ memcpy (&request->packet->answers[idx], &request->packet->answers[r_idx],
+ sizeof (struct GNUNET_DNSPARSER_Record));
+ memcpy (&request->packet->answers[r_idx], &tmp_answer,
+ sizeof (struct GNUNET_DNSPARSER_Record));
+ }
+}