commit:     552884f6eb4308109421cc7f90b6b675b82e48b7
Author:     stkchp <s <AT> tkch <DOT> net>
AuthorDate: Tue Oct 17 03:04:31 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> 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

Reply via email to