From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id DB7C6138CCF for ; Mon, 25 May 2015 10:04:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ACD29E08C7; Mon, 25 May 2015 10:04:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 53F84E08C7 for ; Mon, 25 May 2015 10:04:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AE704340A95 for ; Mon, 25 May 2015 10:04:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 540B59F8 for ; Mon, 25 May 2015 10:04:19 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1426004089.50c9fd7827fa58d27a593c8c480068f85c047cec.vapier@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: net/ X-VCS-Repository: proj/netifrc X-VCS-Files: net/iproute2.sh X-VCS-Directories: net/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 50c9fd7827fa58d27a593c8c480068f85c047cec X-VCS-Branch: master Date: Mon, 25 May 2015 10:04:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8fbd17ea-42bb-4a65-9a8b-8b0d3429fe1a X-Archives-Hash: 4a1101b211bb4dd8207f6de121743644 commit: 50c9fd7827fa58d27a593c8c480068f85c047cec Author: Thomas D whissi de> AuthorDate: Wed Apr 16 09:51:56 2014 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Mar 10 16:14:49 2015 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=50c9fd78 net/iproute2: Add timeout information and timeout progress indicator With this patch we will show the currently set dad_timeout value to the user. The timeout progress will be shown using dots. The idea is stolen from _wait_for_carrier() in init.d/net.lo.in. This patch will also undo commit 732a9a4999f479ee97a404252f6a0eba4a86e338 X-Gentoo-Bug: 488250 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=488250 net/iproute2.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/net/iproute2.sh b/net/iproute2.sh index 7918941..8053b2f 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -351,9 +351,10 @@ _iproute2_ipv6_tentative() iproute2_post_start() { - local n= - eval n=\$dad_timeout_${IFVAR} - [ -z "$n" ] && n=${dad_timeout:-10} + local _dad_timeout= + + eval _dad_timeout=\$dad_timeout_${IFVAR} + _dad_timeout=${_dad_timeout:-${dad_timeout:-5}} local policyroute_order= eval policyroute_order=\$policy_rules_before_routes_${IFVAR} @@ -361,14 +362,22 @@ iproute2_post_start() yesno "$policyroute_order" || _iproute2_policy_routing if _iproute2_ipv6_tentative; then - ebegin "Waiting for IPv6 addresses" - while [ $n -ge 0 ]; do + einfon "Waiting for IPv6 addresses (${_dad_timeout} seconds) " + while [ $_dad_timeout -gt 0 ]; do _iproute2_ipv6_tentative || break sleep 1 - : $(( n -= 1 )) + : $(( _dad_timeout -= 1 )) + printf "." done - [ $n -ge 0 ] - eend $? + + echo "" + + if [ $_dad_timeout -le 0 ]; then + eend 1 + return 1 + else + eend 0 + fi fi return 0