generic-poky/meta/recipes-extended/iputils/files/debian/fix-dead-host-ping-stats.diff

17 lines
699 B
Diff

Upstream-Status: Pending [from other distro Debian]
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);