diff options
Diffstat (limited to 'src/evdns/evdns.c')
-rw-r--r-- | src/evdns/evdns.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/evdns/evdns.c b/src/evdns/evdns.c index e399a14a0..b19da2229 100644 --- a/src/evdns/evdns.c +++ b/src/evdns/evdns.c @@ -1126,6 +1126,7 @@ static u16 default_transaction_id_fn(void) { u16 trans_id; +#ifdef HAVE_CLOCK_GETTIME struct timespec ts; static int clkid = -1; if (clkid == -1) { @@ -1135,6 +1136,13 @@ default_transaction_id_fn(void) } clock_gettime(clkid, &ts); trans_id = ts.tv_nsec & 0xffff; +#elif defined(HAVE_SYS_TIMEDB_H) + struct timeb tb; + ftime(&tb); + trans_id = tb.millitm & 0xffff; +#else +# error Cannot find way to generate dns transaction id +#endif return trans_id; } |