Print received packets as icmp_seq
Subsystems (2)
PATCH 1/1 Print received packets as icmp_seq
Now, ping and ping6 print the packets which are actually received, too, not only the amount of sent packets.
It has the format:
icmp_seq=received/seq
Signed-off-by Alexander Graf <[email protected]>
--- ping_common.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
ping_common.c +1 -1
@@ -711,7 +711,7 @@ restamp: }else {int i;__u8 *cp, *dp; -printf ("%d bytes from %s: icmp_seq=%u" , cc, from, seq); +printf ("%d bytes from %s: icmp_seq=%li/%u" , cc, from, nreceived, seq);if (hops >=0 )printf (" ttl=%d" , hops);
Signature · 1 line
1.5.2.4
PATCH 1/1 Print packet loss with more precision
Signed-off-by Alexander Graf <[email protected]>
--- ping_common.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
ping_common.c +3 -3
@@ -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' );
Signature · 1 line
1.5.2.4