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-235-gab029


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-235-gab029ce
Date: Wed, 16 Jan 2013 16:29: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  ab029ce23a3cfa9f2051cb07fa7c16228c5d3775 (commit)
      from  ba47e906562bd24bac4b24f1c6f8ecc29dfacbdc (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=ab029ce23a3cfa9f2051cb07fa7c16228c5d3775


commit ab029ce23a3cfa9f2051cb07fa7c16228c5d3775
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Jan 16 17:27:06 2013 +0100

    ping: Less verbosity in echo mode.

diff --git a/ChangeLog b/ChangeLog
index 6c5bc95..a9a190b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-16  Mats Erik Andersson  <address@hidden>
+
+       * ping/ping_echo.c (print_ip_header): Empirically test
+       `ip->ip_len' to decide whether ntohs() is needed.
+       (print_icmp): Call print_ip_data() only in verbose mode.
+
 2013-01-16  Guillem Jover  <address@hidden>
 
        * ping/libping.c (ping_xmit): Do not call perror().
diff --git a/ping/ping_echo.c b/ping/ping_echo.c
index 7ba698a..70c5b1d 100644
--- a/ping/ping_echo.c
+++ b/ping/ping_echo.c
@@ -318,8 +318,14 @@ print_ip_header (struct ip *ip)
 
   printf
     ("Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src\tDst\tData\n");
-  printf (" %1x  %1x  %02x %04x %04x", ip->ip_v, ip->ip_hl, ip->ip_tos,
-         ntohs (ip->ip_len), ntohs (ip->ip_id));
+  printf (" %1x  %1x  %02x", ip->ip_v, ip->ip_hl, ip->ip_tos);
+  /*
+   * The member `ip_len' is not portably reported in any byte order.
+   * Use a simple heuristic to print a reasonable value.
+   */
+  printf (" %04x %04x",
+         (ip->ip_len > 0x2000) ? ntohs (ip->ip_len) : ip->ip_len,
+         ntohs (ip->ip_id));
   printf ("   %1x %04x", (ntohs (ip->ip_off) & 0xe000) >> 13,
          ntohs (ip->ip_off) & 0x1fff);
   printf ("  %02x  %02x %04x", ip->ip_ttl, ip->ip_p, ntohs (ip->ip_sum));
@@ -367,7 +373,8 @@ static void
 print_icmp (icmphdr_t * icmp, void *data)
 {
   print_icmp_code (icmp->icmp_type, icmp->icmp_code, data);
-  print_ip_data (icmp, NULL);
+  if (options && OPT_VERBOSE)
+    print_ip_data (icmp, NULL);
 }
 
 static void

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

Summary of changes:
 ChangeLog        |    6 ++++++
 ping/ping_echo.c |   13 ++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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