iputils (3:20100418-3) fix-dead-host-ping-stats.diff

Summary

 ping_common.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

    
download this patch

Patch contents

Index: trunk/ping_common.c
===================================================================
--- trunk.orig/ping_common.c	2010-05-07 23:13:51.000000000 -0700
+++ trunk/ping_common.c	2010-05-07 23:22:33.000000000 -0700
@@ -872,7 +872,8 @@
 		printf("%spipe %d", comma, pipesize);
 		comma = ", ";
 	}
-	if (ntransmitted > 1 && (!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
+	if (ntransmitted > 1 && nreceived &&
+		(!interval || (options&(F_FLOOD|F_ADAPTIVE)))) {
 		int ipg = (1000000*(long long)tv.tv_sec+tv.tv_usec)/(ntransmitted-1);
 		printf("%sipg/ewma %d.%03d/%d.%03d ms",
 		       comma, ipg/1000, ipg%1000, rtt/8000, (rtt/8)%1000);