ping: fix -wN to not think that one packet is always lost
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
2124c0ec97
commit
bc2c1b4f86
@ -471,17 +471,16 @@ static void sendping_tail(void (*sp)(int), int size_pkt)
|
||||
{
|
||||
int sz;
|
||||
|
||||
CLR((uint16_t)G.ntransmitted % MAX_DUP_CHK);
|
||||
G.ntransmitted++;
|
||||
|
||||
size_pkt += datalen;
|
||||
|
||||
if (G.deadline_us) {
|
||||
unsigned n = G.cur_us - G.deadline_us;
|
||||
if ((int)n >= 0)
|
||||
print_stats_and_exit(0);
|
||||
}
|
||||
|
||||
CLR((uint16_t)G.ntransmitted % MAX_DUP_CHK);
|
||||
G.ntransmitted++;
|
||||
size_pkt += datalen;
|
||||
|
||||
/* sizeof(pingaddr) can be larger than real sa size, but I think
|
||||
* it doesn't matter */
|
||||
sz = xsendto(pingsock, G.snd_packet, size_pkt, &pingaddr.sa, sizeof(pingaddr));
|
||||
|
Loading…
Reference in New Issue
Block a user