source: packages/net/mtr/patches/502-fix-res_ninit.patch @ 25784

Last change on this file since 25784 was 25784, checked in by nbd, 6 years ago

mtr: remove some dead code

File size: 1.6 KB
  • dns.c

    a b char nullstring[] = ""; 
    309309 
    310310int use_dns = 1; 
    311311 
    312 #ifdef res_ninit 
    313 #define MY_RES_INIT() res_ninit(&myres); 
    314 #define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ 
    315     res_nmkquery(&myres, a, b, c, d, e, f, g, h, i) 
    316 struct __res_state myres; 
    317 #else 
     312//#ifdef res_ninit 
     313//#define MY_RES_INIT() res_ninit(&myres); 
     314//#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ 
     315//    res_nmkquery(&myres, a, b, c, d, e, f, g, h, i) 
     316//struct __res_state myres; 
     317//#else 
    318318#define MY_RES_INIT() res_init(); 
    319319#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ 
    320320    res_mkquery(a, b, c, d, e, f, g, h, i) 
    321321#define myres _res 
    322 #endif 
     322//#endif 
    323323 
    324324/* Code */ 
    325325#ifdef CorruptCheck 
    res_nmkquery(res_state statp, 
    12671267                return (-1); 
    12681268        memset(buf, 0, HFIXEDSZ); 
    12691269        hp = (HEADER *) buf; 
    1270         /* We randomize the IDs every time.  The old code just 
    1271            incremented by one after the initial randomization which 
    1272            still predictable if the application does multiple 
    1273            requests.  */ 
    1274 #if 0 
    1275         hp->id = htons(++statp->id); 
    1276 #else 
    1277         hp->id = htons(statp->id); 
    1278         int randombits; 
    1279         do 
    1280           { 
    1281 #ifdef RANDOM_BITS 
    1282             RANDOM_BITS (randombits); 
    1283 #else 
    1284             struct timeval tv; 
    1285             gettimeofday (&tv, NULL); 
    1286             randombits = (tv.tv_sec << 8) ^ tv.tv_usec; 
    1287 #endif 
    1288           } 
    1289         while ((randombits & 0xffff) == 0); 
    1290         statp->id = (statp->id + randombits) & 0xffff; 
    1291 #endif 
    12921270        hp->opcode = op; 
    12931271        hp->rd = (statp->options & RES_RECURSE) != 0; 
    12941272        hp->rcode = NOERROR; 
Note: See TracBrowser for help on using the repository browser.