mtr: remove some dead code
authorFelix Fietkau <nbd@openwrt.org>
Mon, 28 Feb 2011 01:17:20 +0000 (01:17 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 28 Feb 2011 01:17:20 +0000 (01:17 +0000)
SVN-Revision: 25784

net/mtr/patches/502-fix-res_ninit.patch

index 8965751204aa29544bd1430a58fb6fabcad9f10c..efece774fd9e50d0f07384f6124c4a238c7a63c8 100644 (file)
  
  /* Code */
  #ifdef CorruptCheck
-@@ -1274,7 +1274,7 @@ res_nmkquery(res_state statp,
- #if 0
-         hp->id = htons(++statp->id);
- #else
+@@ -1267,28 +1267,6 @@ res_nmkquery(res_state statp,
+                 return (-1);
+         memset(buf, 0, HFIXEDSZ);
+         hp = (HEADER *) buf;
+-        /* We randomize the IDs every time.  The old code just
+-           incremented by one after the initial randomization which
+-           still predictable if the application does multiple
+-           requests.  */
+-#if 0
+-        hp->id = htons(++statp->id);
+-#else
 -        hp->id = htons(statp->id);
-+//        hp->id = htons(statp->id);
-         int randombits;
-         do
-           {
-@@ -1287,7 +1287,7 @@ res_nmkquery(res_state statp,
- #endif
-           }
-         while ((randombits & 0xffff) == 0);
+-        int randombits;
+-        do
+-          {
+-#ifdef RANDOM_BITS
+-            RANDOM_BITS (randombits);
+-#else
+-            struct timeval tv;
+-            gettimeofday (&tv, NULL);
+-            randombits = (tv.tv_sec << 8) ^ tv.tv_usec;
+-#endif
+-          }
+-        while ((randombits & 0xffff) == 0);
 -        statp->id = (statp->id + randombits) & 0xffff;
-+//        statp->id = (statp->id + randombits) & 0xffff;
- #endif
+-#endif
          hp->opcode = op;
          hp->rd = (statp->options & RES_RECURSE) != 0;
+         hp->rcode = NOERROR;