bug-inetutils
[Top][All Lists]
Advanced

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

Re: [bug-inetutils] Ping6 bug - timing gone wild


From: Debarshi Ray
Subject: Re: [bug-inetutils] Ping6 bug - timing gone wild
Date: Sun, 20 Apr 2008 08:45:31 +0530

>  I believe the bug is in incorrect pointer handling at print_echo() (see
>  patch below). Possibly the bug does not manifest itself on architectures
>  where sizeof(timeval) == sizeof(icmp6_hdr).

Michal's patch fixes it for me (GNU/Linux x86_64). Can anyone confirm
if it breaks anything on other systems? If not, then I plan to commit
the following patch on Michal's behalf:

diff -urNp inetutils/ping/ping6.c inetutils-build/ping/ping6.c
--- inetutils/ping/ping6.c      2007-12-10 21:17:19.000000000 +0530
+++ inetutils-build/ping/ping6.c        2008-04-19 22:42:53.000000000 +0530
@@ -449,7 +449,7 @@ print_echo (int dupflag, int hops, struc
       struct timeval tv1, *tp;

       timing++;
-      tp = (struct timeval *) icmp6 + 1;
+      tp = (struct timeval *) (icmp6 + 1);

       /* Avoid unaligned data: */
       memcpy (&tv1, tp, sizeof (tv1));
diff -urNp inetutils/ChangeLog inetutils-build/ChangeLog
--- inetutils/ChangeLog 2008-04-19 09:27:05.000000000 +0530
+++ inetutils-build/ChangeLog   2008-04-20 08:38:51.000000000 +0530
@@ -1,3 +1,8 @@
+2008-04-20  Michal Svoboda <address@hidden> (tiny change)
+
+       * ping/ping6.c (print_echo): Cast ICMP6+1 and not ICMP6 to
+       `struct timeval *'.
+
 2008-04-19  Debarshi Ray <address@hidden>

        * traceroute/traceroute.c: Added new switch --type.

Happy hacking,
Debarshi
-- 
"From what we get, we can make a living; what we give, however, makes a life."
    -- Arthur Ashe




reply via email to

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