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 99D3B1396D9 for ; Sat, 21 Oct 2017 20:56:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E5F762BC003; Sat, 21 Oct 2017 20:56:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C59872BC003 for ; Sat, 21 Oct 2017 20:56:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 E507233BF0B for ; Sat, 21 Oct 2017 20:56:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 722DB30B for ; Sat, 21 Oct 2017 20:56:24 +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: <1508419824.552884f6eb4308109421cc7f90b6b675b82e48b7.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: 552884f6eb4308109421cc7f90b6b675b82e48b7 X-VCS-Branch: master Date: Sat, 21 Oct 2017 20:56:24 +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: ab9310f2-3ddc-4ed7-8801-ecdab8894731 X-Archives-Hash: 0e63d69dd7fa94694ff210224da634ec commit: 552884f6eb4308109421cc7f90b6b675b82e48b7 Author: stkchp tkch net> AuthorDate: Tue Oct 17 03:04:31 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Thu Oct 19 13:30:24 2017 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=552884f6 net/iproute2: delete IPv6 tunnel. net/iproute2.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/net/iproute2.sh b/net/iproute2.sh index d5612ab..7dea195 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -434,6 +434,13 @@ iproute2_pre_start() return 0 } +_iproute2_tunnel_delete() { + ebegin "Destroying tunnel $1" + veinfo ip $2 tunnel del "$1" + ip $2 tunnel del "$1" + eend $? +} + _iproute2_link_delete() { ebegin "Destroying interface $1" veinfo ip link del dev "$1" @@ -518,11 +525,11 @@ iproute2_post_stop() # Don't delete sit0 as it's a special tunnel if [ "${IFACE}" != "sit0" ]; then if [ -n "$(ip tunnel show "${IFACE}" 2>/dev/null)" ]; then - ebegin "Destroying tunnel ${IFACE}" - veinfo ip tunnel del "${IFACE}" - ip tunnel del "${IFACE}" - eend $? + _iproute2_tunnel_delete "${IFACE}" + elif [ -n "$(ip -6 tunnel show "${IFACE}" 2>/dev/null)" ]; then + _iproute2_tunnel_delete "${IFACE}" -6 fi + [ -n "$(ip link show "${IFACE}" type gretap 2>/dev/null)" ] && _iproute2_link_delete "${IFACE}" [ -n "$(ip link show "${IFACE}" type vxlan 2>/dev/null)" ] && _iproute2_link_delete "${IFACE}" fi