From owner-svn-src-stable@FreeBSD.ORG Mon Aug 11 07:01:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A072AB4 for ; Mon, 11 Aug 2014 07:01:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D422C2773 for ; Mon, 11 Aug 2014 07:01:29 +0000 (UTC) Received: from delphij (uid 1035) (envelope-from delphij@FreeBSD.org) id 2bd8 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Mon, 11 Aug 2014 07:01:29 +0000 From: Xin LI Date: Mon, 11 Aug 2014 07:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r269803 - stable/8/sbin/ping6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e86a49.2bd8.4ed1ec96@svn.freebsd.org> X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2014 07:01:30 -0000 Author: delphij Date: Mon Aug 11 07:01:29 2014 New Revision: 269803 URL: http://svnweb.freebsd.org/changeset/base/269803 Log: 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 Modified: stable/8/sbin/ping6/ping6.c Directory Properties: stable/8/sbin/ping6/ (props changed) Modified: stable/8/sbin/ping6/ping6.c ============================================================================== --- stable/8/sbin/ping6/ping6.c Mon Aug 11 07:00:57 2014 (r269802) +++ stable/8/sbin/ping6/ping6.c Mon Aug 11 07:01:29 2014 (r269803) @@ -1093,8 +1093,14 @@ main(argc, 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;