1 |
commit: 552884f6eb4308109421cc7f90b6b675b82e48b7 |
2 |
Author: stkchp <s <AT> tkch <DOT> net> |
3 |
AuthorDate: Tue Oct 17 03:04:31 2017 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 19 13:30:24 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=552884f6 |
7 |
|
8 |
net/iproute2: delete IPv6 tunnel. |
9 |
|
10 |
net/iproute2.sh | 15 +++++++++++---- |
11 |
1 file changed, 11 insertions(+), 4 deletions(-) |
12 |
|
13 |
diff --git a/net/iproute2.sh b/net/iproute2.sh |
14 |
index d5612ab..7dea195 100644 |
15 |
--- a/net/iproute2.sh |
16 |
+++ b/net/iproute2.sh |
17 |
@@ -434,6 +434,13 @@ iproute2_pre_start() |
18 |
return 0 |
19 |
} |
20 |
|
21 |
+_iproute2_tunnel_delete() { |
22 |
+ ebegin "Destroying tunnel $1" |
23 |
+ veinfo ip $2 tunnel del "$1" |
24 |
+ ip $2 tunnel del "$1" |
25 |
+ eend $? |
26 |
+} |
27 |
+ |
28 |
_iproute2_link_delete() { |
29 |
ebegin "Destroying interface $1" |
30 |
veinfo ip link del dev "$1" |
31 |
@@ -518,11 +525,11 @@ iproute2_post_stop() |
32 |
# Don't delete sit0 as it's a special tunnel |
33 |
if [ "${IFACE}" != "sit0" ]; then |
34 |
if [ -n "$(ip tunnel show "${IFACE}" 2>/dev/null)" ]; then |
35 |
- ebegin "Destroying tunnel ${IFACE}" |
36 |
- veinfo ip tunnel del "${IFACE}" |
37 |
- ip tunnel del "${IFACE}" |
38 |
- eend $? |
39 |
+ _iproute2_tunnel_delete "${IFACE}" |
40 |
+ elif [ -n "$(ip -6 tunnel show "${IFACE}" 2>/dev/null)" ]; then |
41 |
+ _iproute2_tunnel_delete "${IFACE}" -6 |
42 |
fi |
43 |
+ |
44 |
[ -n "$(ip link show "${IFACE}" type gretap 2>/dev/null)" ] && _iproute2_link_delete "${IFACE}" |
45 |
[ -n "$(ip link show "${IFACE}" type vxlan 2>/dev/null)" ] && _iproute2_link_delete "${IFACE}" |
46 |
fi |