]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
mtr v0.50 v0.50
authorRoger Wolff <r.e.wolff@bitwizard.nl>
Tue, 7 May 2002 00:00:00 +0000 (00:00 +0000)
committerTravis Cross <tc@traviscross.com>
Sun, 3 Feb 2013 20:45:37 +0000 (20:45 +0000)
 - Make "interface address" option work.  Changes to "select" loop to
   allow window resizes (select interruption) to work. Thanks Mike!

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.50.tar.gz

AUTHORS
NEWS
TODO
configure.in
mtr.c
select.c

diff --git a/AUTHORS b/AUTHORS
index 828446449689378a3233e5470d06966a76f66c19..fdd5b58b6c2fdd5d35e9e6ac97d447db7a08825a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
 
         Bohdan Vlasyuk (bohdan@cec.vstu.vinnica.ua)
         Juha Takala
+        evtr@ukr.net (Evgeniy Tretyak)
         David Sward (sward@clark.net)
         David Stone (stone@AsIf.com)
         Andrew Stesin
         Greg Stark (gsstark@mit.edu)
         Robert Sparks (rjsparks@nostrum.com)
+        Mike Simons (msimons@moria.simons-clan.com)
         Aaron Scarisbrick,
         Craig Milo Rogers (Rogers@ISI.EDU)
         Russell Nelson (rn-mtr@crynwr.com)
diff --git a/NEWS b/NEWS
index c056e812b1d1eeab6f24a559568ffeb7cb528a13..a0cd6950d119629e6a12e1c084d1dd9fcdf7c6e8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,8 @@
 WHAT'S NEW?
+  v0.50 Make "interface address" option work.
+        Changes to "select" loop to allow window resizes (select 
+        interruption) to work. Thanks Mike!
+
   v0.49 Fix compilation problems on several platforms.
 
   v0.48 Draw names in red (GTK) or bold (Curses) if host doesn't 
@@ -13,7 +17,7 @@ WHAT'S NEW?
   v0.45 People are pressuring me to release new versions with their
         changes. That's fine. Now this version just adds dynamic
         switching between numeric / dns names, and some minor
-        stuff I forgot. This release serves as a code-sycn-release.
+        stuff I forgot. This release serves as a code-sync-release.
         new version with even more new stuff in about two weeks!
         I'm afraid I don't know how to fix the MaxOS-X compilation
         problems in the source. Help wanted... 
@@ -22,7 +26,7 @@ WHAT'S NEW?
 
   v0.43 Compile fixes.
 
-  v0.41 Added afr's patch to allow disabeling of gtk without Robn's hack. 
+  v0.41 Added afr's patch to allow disabling of gtk without Robn's hack. 
         Made report mode report the newly added extra resolution. 
 
   v0.40 Fixed some problems with HPUX and SunOS.
diff --git a/TODO b/TODO
index 2c2b34d40c7dd6d91d1c4544db6eca9c5682a0d4..381e6f9f5e21ec08d544f91d3933a85c5672fc63 100644 (file)
--- a/TODO
+++ b/TODO
@@ -73,19 +73,28 @@ Oh, Feel free to provide suggestions for this list.
     At the moment (march 1999) autoconf 2.13 is still too new to require 
     everyone to upgrade. About a year from now we can put this in....
 
-  - Allow a toggle between hostname/IP number display. (for example a 
-    click on the hostname could revert to ip number display in gtk version.
-    curses: "n" key toggles hostnames/ipnumbers?)
-
   - Implement rfc2317 mechanism to do reverse lookups for networks that
     have DNS delegations on non-octet boundaries. -- Daniel Bergstrom
     (noa@melody.se)
 
+  - The longer MTR runs, the less meaningful the packet loss
+    statistic. Or more meaningful, depending on your point of view.
+    Perhaps MTR should use a circular buffer of some configurable
+    number of results, and calculate the loss against that. -- Jacob Elder
+
+  - It would be nice if the window size wasn't fixed. If I'm only 5
+    hops from the host I'm monitoring, MTR wastes a lot of screen real
+    estate. -- Jacob Elder
+
 
 ------------------------------------------------------------------------
 
 Things that shouldn't be on the TODO list because they're done. ;-)
 
+  - Allow a toggle between hostname/IP number display. (for example a 
+    click on the hostname could revert to ip number display in gtk version.
+    curses: "n" key toggles hostnames/ipnumbers?)
+
   - Allow mtr to also send larger packets. 
        This will enable us to get a feel for the speed of the links
        we're traversing. (Van Jacobson was working on this His tool
index 8bf0f5c88fb14903728a0ad9d6ce2e60daa23145..4738aabc15512519135c088f80c4a8bb54fce1a6 100644 (file)
@@ -1,5 +1,5 @@
 AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.49)
+AM_INIT_AUTOMAKE(mtr, 0.50)
 
 AC_SUBST(GTK_OBJ)
 AC_SUBST(CURSES_OBJ)
diff --git a/mtr.c b/mtr.c
index fec5bd8bc4f723d8c7d1c4a0cd720c228e99ed52..467997d59a7477915f2ed47e6da71b6e52b51b6a 100644 (file)
--- a/mtr.c
+++ b/mtr.c
@@ -217,6 +217,8 @@ int main(int argc, char **argv) {
     char dummy;
     extern int sendsock; /* from net.c:115 */
 
+    bzero(&source, sizeof(source)); /* -- Evgeniy Tretyak */
+
     source.sin_family = AF_INET;
     source.sin_port = 0;
 
index 4b5e5a71876ceb1faeb5fa62cd545a338989b1bf..2620b31c6629a889302677cf8f0ec603da6fc9e6 100644 (file)
--- a/select.c
+++ b/select.c
@@ -25,6 +25,7 @@
 #include <sys/select.h>
 #include <string.h>
 #include <math.h>
+#include <errno.h>
 
 #include "display.h"
 #include "dns.h"
@@ -48,6 +49,7 @@ void select_loop() {
   struct timeval lasttime, thistime, selecttime;
   float wt;
   int dt;
+  int rv; 
 
   NumPing = 0; 
   anyset = 0;
@@ -78,50 +80,56 @@ void select_loop() {
     if(netfd >= maxfd)
       maxfd = netfd + 1;
 
-    if(anyset || paused) {
-      selecttime.tv_sec = 0;
-      selecttime.tv_usec = 0;
+    do {
+      if(anyset || paused) {
+       selecttime.tv_sec = 0;
+       selecttime.tv_usec = 0;
       
-      select(maxfd, (void *)&readfd, NULL, NULL, &selecttime);
-    } else {
-      if(Interactive) 
-       display_redraw();
-
-      gettimeofday(&thistime, NULL);
-
-      if(thistime.tv_sec > lasttime.tv_sec + intervaltime.tv_sec ||
-         (thistime.tv_sec == lasttime.tv_sec + intervaltime.tv_sec &&
-          thistime.tv_usec >= lasttime.tv_usec + intervaltime.tv_usec)) {
-        lasttime = thistime;
-        if(NumPing >= MaxPing && !Interactive)
-          break;
-        if (net_send_batch())
-         NumPing++;
+       rv = select(maxfd, (void *)&readfd, NULL, NULL, &selecttime);
+      } else {
+       if(Interactive) 
+         display_redraw();
+
+       gettimeofday(&thistime, NULL);
+
+       if(thistime.tv_sec > lasttime.tv_sec + intervaltime.tv_sec ||
+          (thistime.tv_sec == lasttime.tv_sec + intervaltime.tv_sec &&
+           thistime.tv_usec >= lasttime.tv_usec + intervaltime.tv_usec)) {
+         lasttime = thistime;
+         if(NumPing >= MaxPing && !Interactive)
+           break;
+         if (net_send_batch())
+           NumPing++;
+       }
+
+       selecttime.tv_usec = (thistime.tv_usec - lasttime.tv_usec);
+       selecttime.tv_sec = (thistime.tv_sec - lasttime.tv_sec);
+       if (selecttime.tv_usec < 0) {
+         --selecttime.tv_sec;
+         selecttime.tv_usec += 1000000;
+       }
+       selecttime.tv_usec = intervaltime.tv_usec - selecttime.tv_usec;
+       selecttime.tv_sec = intervaltime.tv_sec - selecttime.tv_sec;
+       if (selecttime.tv_usec < 0) {
+         --selecttime.tv_sec;
+         selecttime.tv_usec += 1000000;
+       }
+
+       if ((selecttime.tv_sec > (time_t)dnsinterval) ||
+           ((selecttime.tv_sec == (time_t)dnsinterval) &&
+            (selecttime.tv_usec > ((time_t)(dnsinterval * 1000000) % 1000000)))) {
+         selecttime.tv_sec = (time_t)dnsinterval;
+         selecttime.tv_usec = (time_t)(dnsinterval * 1000000) % 1000000;
+       }
+
+       rv = select(maxfd, (void *)&readfd, NULL, NULL, &selecttime);
       }
+    } while ((rv < 0) && (errno == EINTR));
 
-      selecttime.tv_usec = (thistime.tv_usec - lasttime.tv_usec);
-      selecttime.tv_sec = (thistime.tv_sec - lasttime.tv_sec);
-      if (selecttime.tv_usec < 0) {
-       --selecttime.tv_sec;
-       selecttime.tv_usec += 1000000;
-      }
-      selecttime.tv_usec = intervaltime.tv_usec - selecttime.tv_usec;
-      selecttime.tv_sec = intervaltime.tv_sec - selecttime.tv_sec;
-      if (selecttime.tv_usec < 0) {
-       --selecttime.tv_sec;
-       selecttime.tv_usec += 1000000;
-      }
-
-      if ((selecttime.tv_sec > (time_t)dnsinterval) ||
-          ((selecttime.tv_sec == (time_t)dnsinterval) &&
-           (selecttime.tv_usec > ((time_t)(dnsinterval * 1000000) % 1000000)))) {
-        selecttime.tv_sec = (time_t)dnsinterval;
-        selecttime.tv_usec = (time_t)(dnsinterval * 1000000) % 1000000;
-      }
-
-      select(maxfd, (void *)&readfd, NULL, NULL, &selecttime);
+    if (rv < 0) {
+      perror ("Select failed");
+      exit (1);
     }
-
     anyset = 0;
 
     /* Handle any pending resolver events */