aboutsummaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index b03cbb5aad..64cfcb024e 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -179,11 +179,21 @@ evdns_log_cb(int warn, const char *msg)
log(severity, LD_EXIT, "eventdns: %s", msg);
}
+/** Helper: generate a good random transaction ID. */
+static uint16_t
+dns_get_transaction_id(void)
+{
+ uint16_t result;
+ crypto_rand((void*)&result, sizeof(result));
+ return result;
+}
+
/** Initialize the DNS subsystem; called by the OR process. */
int
dns_init(void)
{
init_cache_map();
+ evdns_set_transaction_id_fn(dns_get_transaction_id);
if (server_mode(get_options()))
return configure_nameservers(1);
return 0;