diff options
author | delphij <delphij@FreeBSD.org> | 2014-08-11 06:54:07 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-08-11 06:54:07 +0000 |
commit | dbecd3b0d9a4d78230faccf83198b48e4945cfdc (patch) | |
tree | f5d1759185e720f92b146c8f15ded581894a0e45 /sbin | |
parent | 6b999dff3e159c3cb1559a30c663435c3265807b (diff) | |
download | FreeBSD-src-dbecd3b0d9a4d78230faccf83198b48e4945cfdc.zip FreeBSD-src-dbecd3b0d9a4d78230faccf83198b48e4945cfdc.tar.gz |
MFC r269180:
When interval is set to very small value with limited amount of packets,
ping6(8) would quit before the remote side gets a chance to respond.
Solve this by resetting the itimer when we have reached the maximum packet
number have reached, but let the other handling to continue.
PR: bin/151023
Submitted by: tjmao at tjmao.net
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping6/ping6.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 01e29a1..b963de1 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1090,8 +1090,14 @@ main(int argc, char *argv[]) /* signal handling */ if (seenalrm) { /* last packet sent, timeout reached? */ - if (npackets && ntransmitted >= npackets) - break; + if (npackets && ntransmitted >= npackets) { + struct timeval zerotime = {0, 0}; + itimer.it_value = zerotime; + itimer.it_interval = zerotime; + (void)setitimer(ITIMER_REAL, &itimer, NULL); + seenalrm = 0; /* clear flag */ + continue; + } retransmit(); seenalrm = 0; continue; |