From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F25B0139083 for ; Fri, 9 Jun 2017 23:59:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E546E21C0AA; Fri, 9 Jun 2017 23:59:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C024D21C0AA for ; Fri, 9 Jun 2017 23:59:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A87F63418AC for ; Fri, 9 Jun 2017 23:59:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 44DCE2FA for ; Fri, 9 Jun 2017 23:59:21 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1497052729.90f9fd0cee3284767d42d314683e22eb0613c55f.robbat2@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: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 90f9fd0cee3284767d42d314683e22eb0613c55f X-VCS-Branch: master Date: Fri, 9 Jun 2017 23:59:21 +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: ecab732f-f146-4b26-b7ca-202275c5fed9 X-Archives-Hash: affa16185ddddad5ce0d351d0c415697 commit: 90f9fd0cee3284767d42d314683e22eb0613c55f Author: Robin H. Johnson gentoo org> AuthorDate: Fri Jun 9 23:58:49 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Fri Jun 9 23:58:49 2017 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=90f9fd0c iproute2: apply ipproto=-6 cleanup. Case statements for easier reading of ipproto='-6' choice. Fixes: https://github.com/gentoo/netifrc/pull/24/files/60714158b4536d1e5694ec8a45e2cfac56202027#r98297184 Signed-off-by: Robin H. Johnson gentoo.org> net/iproute2.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/net/iproute2.sh b/net/iproute2.sh index 55c9592..d5612ab 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -381,10 +381,11 @@ iproute2_pre_start() # be passed to iproute2 during tunnel creation. # state 'any' does not exist for IPv4 local ipproto='' - [ "${tunnel##mode ipip6}" != "${tunnel}" ] && ipproto='-6' - [ "${tunnel##mode ip6ip6}" != "${tunnel}" ] && ipproto='-6' - [ "${tunnel##mode ip6gre}" != "${tunnel}" ] && ipproto='-6' - [ "${tunnel##mode any}" != "${tunnel}" ] && ipproto='-6' + case $tunnel in + *mode\ ipip6*) ipproto='-6' ;; + *mode\ ip6*) ipproto='-6' ;; + *mode\ any*) ipproto='-6' ;; + esac ebegin "Creating tunnel ${IFVAR}" veinfo ip ${ipproto} tunnel add ${tunnel} name "${IFACE}" @@ -396,9 +397,11 @@ iproute2_pre_start() eval link=\$iplink_${IFVAR} if [ -n "${link}" ]; then local ipproto='' - [ "${tunnel##mode ip6gre}" != "${tunnel}" ] && ipproto='-6' - [ "${tunnel##mode ip6gretap}" != "${tunnel}" ] && ipproto='-6' - [ "${tunnel##mode ip6tnl}" != "${tunnel}" ] && ipproto='-6' + case $tunnel in + *mode\ ipip6*) ipproto='-6' ;; + *mode\ ip6*) ipproto='-6' ;; + *mode\ any*) ipproto='-6' ;; + esac ebegin "Creating interface ${IFVAR}" veinfo ip ${ipproto} link add "${IFACE}" ${link}