Comment 4 for bug 1405232

Revision history for this message
Martijn Lievaart (j-launchpad-net-rtij-nl) wrote :

I Noted the nexthop field is wrong as well in my last output.

What happens is a wrong optimisation. the pr_addr function assumes it is always called with the same address, so it just returns the previous buffer on subsequent invocations.

The following quickfix fixes both the issue in this ticket as the nexthop issue.

$ diff -U3 ping.c{~,}
--- ping.c~ 2015-02-12 13:00:18.000000000 +0100
+++ ping.c 2015-02-12 13:45:47.515167752 +0100
@@ -1244,10 +1244,10 @@
 {
  struct hostent *hp;
  static char buf[4096] = "";
-
+ /*
  if (*buf)
   return(buf);
-
+ */
  in_pr_addr = !setjmp(pr_addr_jmp);

  if (exiting || (options & F_NUMERIC) ||

I think this can be kicked upstream.