Merge pull request #9224 from maribu/ping6

shell_commands/ping6: Fixed bug in calculation of average round trip time
This commit is contained in:
Martine Lenders 2018-05-29 14:27:49 +02:00 committed by GitHub
commit ced615a7ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -129,7 +129,7 @@ static void _print_stats(char *addr_str, int success, int count, uint64_t total_
printf("--- %s ping statistics ---\n", addr_str);
if (success > 0) {
uint32_t avg_rtt = (uint32_t)(sum_rtt / count); /* get average */
uint32_t avg_rtt = (uint32_t)(sum_rtt / success); /* get average */
printf("%d packets transmitted, %d received, %d%% packet loss, time %"
PRIu32 ".06%" PRIu32 " s\n", count, success,
(100 - ((success * 100) / count)),