From 22b629bdd3c3eaf3621b30b25d88a685f428cad9 Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 30 Apr 2016 09:43:01 +0000 Subject: [PATCH] MFstable/10 r272871: r272871 (by hrs): MFC r271909: Revert changes in r269180. It could cause -c N option to enter an infinite loop if no reply packet is received. git-svn-id: svn://svn.freebsd.org/base/stable/9@298843 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/ping6/ping6.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 5b4133f9a..18daba3ce 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1088,14 +1088,8 @@ main(int argc, char *argv[]) /* signal handling */ if (seenalrm) { /* last packet sent, timeout reached? */ - 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; - } + if (npackets && ntransmitted >= npackets) + break; retransmit(); seenalrm = 0; continue; -- 2.45.0