lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <11864945931233-git-send-email-sohalt@gmail.com>
Date:	Tue,  7 Aug 2007 15:49:50 +0200
From:	Alexander Graf <sohalt@...il.com>
To:	netdev@...r.kernel.org
Cc:	Alexander Graf <sohalt@...il.com>
Subject: [PATCH] [iputils] Print packet loss with more precision

Signed-off-by: Alexander Graf <sohalt@...il.com>
---
 ping_common.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ping_common.c b/ping_common.c
index 83be553..49acab2 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -795,9 +795,9 @@ void finish(void)
 	if (nerrors)
 		printf(", +%ld errors", nerrors);
 	if (ntransmitted) {
-		printf(", %d%% packet loss",
-		       (int) ((((long long)(ntransmitted - nreceived)) * 100) /
-			      ntransmitted));
+		printf(", %f%% packet loss",
+		       (((long long)(ntransmitted - nreceived)) * 100.0) /
+			      ntransmitted);
 		printf(", time %ldms", 1000*tv.tv_sec+tv.tv_usec/1000);
 	}
 	putchar('\n');
-- 
1.5.2.4


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ