net/mtr: update to mtr-0.79 & fix compile issues
[openwrt/svn-archive/archive.git] / net / mtr / patches / 502-fix-res_ninit.patch
1 --- a/dns.c
2 +++ b/dns.c
3 @@ -309,17 +309,17 @@ char nullstring[] = "";
4
5 int use_dns = 1;
6
7 -#ifdef res_ninit
8 -#define RES_INIT() res_ninit(&myres);
9 -#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \
10 - res_nmkquery(&myres, a, b, c, d, e, f, g, h, i)
11 -struct __res_state myres;
12 -#else
13 +//#ifdef res_ninit
14 +//#define RES_INIT() res_ninit(&myres);
15 +//#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \
16 +// res_nmkquery(&myres, a, b, c, d, e, f, g, h, i)
17 +//struct __res_state myres;
18 +//#else
19 #define RES_INIT() res_init();
20 #define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \
21 res_mkquery(a, b, c, d, e, f, g, h, i)
22 #define myres _res
23 -#endif
24 +//#endif
25
26 /* Code */
27 #ifdef CorruptCheck
28 @@ -1274,7 +1274,7 @@ res_nmkquery(res_state statp,
29 #if 0
30 hp->id = htons(++statp->id);
31 #else
32 - hp->id = htons(statp->id);
33 +// hp->id = htons(statp->id);
34 int randombits;
35 do
36 {
37 @@ -1287,7 +1287,7 @@ res_nmkquery(res_state statp,
38 #endif
39 }
40 while ((randombits & 0xffff) == 0);
41 - statp->id = (statp->id + randombits) & 0xffff;
42 +// statp->id = (statp->id + randombits) & 0xffff;
43 #endif
44 hp->opcode = op;
45 hp->rd = (statp->options & RES_RECURSE) != 0;