elfutils: moved to github
[openwrt/svn-archive/packages.git] / net / mtr / patches / 502-fix-res_ninit.patch
1 --- a/dns.c
2 +++ b/dns.c
3 @@ -1267,28 +1267,6 @@ res_nmkquery(res_state statp,
4 return (-1);
5 memset(buf, 0, HFIXEDSZ);
6 hp = (HEADER *) buf;
7 - /* We randomize the IDs every time. The old code just
8 - incremented by one after the initial randomization which
9 - still predictable if the application does multiple
10 - requests. */
11 -#if 0
12 - hp->id = htons(++statp->id);
13 -#else
14 - hp->id = htons(statp->id);
15 - int randombits;
16 - do
17 - {
18 -#ifdef RANDOM_BITS
19 - RANDOM_BITS (randombits);
20 -#else
21 - struct timeval tv;
22 - gettimeofday (&tv, NULL);
23 - randombits = (tv.tv_sec << 8) ^ tv.tv_usec;
24 -#endif
25 - }
26 - while ((randombits & 0xffff) == 0);
27 - statp->id = (statp->id + randombits) & 0xffff;
28 -#endif
29 hp->opcode = op;
30 hp->rd = (statp->options & RES_RECURSE) != 0;
31 hp->rcode = NOERROR;