summaryrefslogtreecommitdiffstats
path: root/meta-lsb/packages/iputils/files/debian/fix-dead-host-ping-stats.diff
blob: 2a924258da9b2964aeeb937d71bc2bcd40689ef6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);