commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-78-g3aae67


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-78-g3aae672
Date: Fri, 20 Apr 2012 13:28:11 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  3aae672f300bd655d4a86405183ee462ad1abc34 (commit)
      from  6dec6e1745be4386f3bc48ad6ca6df7e27100fe7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=3aae672f300bd655d4a86405183ee462ad1abc34


commit 3aae672f300bd655d4a86405183ee462ad1abc34
Author: Mats Erik Andersson <address@hidden>
Date:   Fri Apr 20 14:04:36 2012 +0200

    ping, ping6, traceroute: 64-bit portability issues.

diff --git a/ChangeLog b/ChangeLog
index e1aa06f..9c3308e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2012-04-20  Mats Erik Andersson  <address@hidden>
 
+       Portability issue found on 64-bit OpenBSD.
+
+       * ping/ping.c (ping_run): Break infinite loop by calling error()
+       after failure in select().
+       * ping/ping6.c (ping_run): Likewise.  Clear RESP_TIME.
+       * src/traceroute.c (do_try): New variable FD.  Clear TIME and
+       calculate NOW before calling select().  Set `fd + 1' to be the
+       maximal file descriptor when calling select().  On failure in
+       select(), return `errno' for proper detection, not EPERM.
+
+2012-04-20  Mats Erik Andersson  <address@hidden>
+
        rexec, rexecd: Implement support for IPv6.
 
        * src/rexec.c (options): New `-4/ipv4', `-6/ipv6', and `-a/ipany'.
diff --git a/ping/ping.c b/ping/ping.c
index edfd758..462cc22 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -372,7 +372,7 @@ ping_run (PING * ping, int (*finish) ())
       if (n < 0)
        {
          if (errno != EINTR)
-           perror ("select");
+           error (EXIT_FAILURE, errno, "select failed");
          continue;
        }
       else if (n == 1)
diff --git a/ping/ping6.c b/ping/ping6.c
index 5647ded..445ced8 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -305,6 +305,7 @@ ping_run (PING * ping, int (*finish) ())
       FD_ZERO (&fdset);
       FD_SET (ping->ping_fd, &fdset);
       gettimeofday (&now, NULL);
+      memset (&resp_time, 0, sizeof (resp_time));      /* 64-bit issue */
       resp_time.tv_sec = last.tv_sec + intvl.tv_sec - now.tv_sec;
       resp_time.tv_usec = last.tv_usec + intvl.tv_usec - now.tv_usec;
 
@@ -326,7 +327,7 @@ ping_run (PING * ping, int (*finish) ())
       if (n < 0)
        {
          if (errno != EINTR)
-           perror ("select");
+           error (EXIT_FAILURE, errno, "select failed");
          continue;
        }
       else if (n == 1)
diff --git a/src/traceroute.c b/src/traceroute.c
index 1d53d1e..df17661 100644
--- a/src/traceroute.c
+++ b/src/traceroute.c
@@ -240,22 +240,26 @@ do_try (trace_t * trace, const int hop,
 
   for (tries = 0; tries < max_tries; tries++)
     {
+      int fd = trace_icmp_sock (trace);
+
       FD_ZERO (&readset);
-      FD_SET (trace_icmp_sock (trace), &readset);
+      FD_SET (fd, &readset);
 
+      memset (&time, 0, sizeof (time));                /* 64-bit issue.  */
       time.tv_sec = TIME_INTERVAL;
       time.tv_usec = 0;
 
       if (!readonly)
        trace_write (trace);
 
-      ret = select (FD_SETSIZE, &readset, NULL, NULL, &time);
-
       gettimeofday (&now, NULL);
 
       now.tv_usec -= trace->tsent.tv_usec;
       now.tv_sec -= trace->tsent.tv_sec;
 
+      errno = 0;
+      ret = select (fd + 1, &readset, NULL, NULL, &time);
+
       if (ret < 0)
        {
          switch (errno)
@@ -264,7 +268,7 @@ do_try (trace_t * trace, const int hop,
              /* was interrupted */
              break;
            default:
-              error (EXIT_FAILURE, EPERM, "select failed");
+              error (EXIT_FAILURE, errno, "select failed");
              break;
            }
        }
@@ -276,7 +280,7 @@ do_try (trace_t * trace, const int hop,
        }
       else
        {
-         if (FD_ISSET (trace_icmp_sock (trace), &readset))
+         if (FD_ISSET (fd, &readset))
            {
              triptime = ((double) now.tv_sec) * 1000.0 +
                ((double) now.tv_usec) / 1000.0;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |   12 ++++++++++++
 ping/ping.c      |    2 +-
 ping/ping6.c     |    3 ++-
 src/traceroute.c |   14 +++++++++-----
 4 files changed, 24 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]