Package: iputils-ping
Version: 3:20101006-2
Severity: minor
Tags: patch

Ping output is buffered when a truncated echo reply occurs, preventing from
parsing it easily.

For example

ping -c 8 -s 100 8.8.8.8 | grep ttl

will throw its output once all echo replies have been received.




-- System Information:
Debian Release: 6.0.1
  APT prefers stable-updates
  APT policy: (990, 'stable-updates'), (990, 'proposed-updates'), (990,
'stable'), (190, 'testing'), (180, 'testing-proposed-updates')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages iputils-ping depends on:
ii  libc6                   2.11.2-10        Embedded GNU C Library: Shared lib
ii  libssl0.9.8             0.9.8o-4squeeze1 SSL shared libraries

iputils-ping recommends no packages.

iputils-ping suggests no packages.
--- ping.c	2011-06-02 11:04:10.000000000 +0200
+++ ping.c.new	2011-06-02 11:04:22.488924709 +0200
@@ -717,8 +717,10 @@
 		if (gather_statistics((__u8*)icp, sizeof(*icp), cc,
 				      ntohs(icp->un.echo.sequence),
 				      ip->ttl, 0, tv, pr_addr(from->sin_addr.s_addr),
-				      pr_echo_reply))
+				      pr_echo_reply)) {
+			fflush(stdout);
 			return 0;
+		}
 	} else {
 		/* We fall here when a redirect or source quench arrived.
 		 * Also this branch processes icmp errors, when IP_RECVERR

Reply via email to