summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2014-06-24 15:29:49 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2014-06-24 15:33:00 +0200
commit0f51aa966b1afb835425f8a4c91ec38f4f36babc (patch)
treede2dcb3ea53359de0060275f0154af3d96481ea4 /src/lib
parent29700d1993f9108d1cebda02fc7c70d0e2aaeedb (diff)
downloadnetctl-0f51aa966b1afb835425f8a4c91ec38f4f36babc.tar.gz
netctl-0f51aa966b1afb835425f8a4c91ec38f4f36babc.tar.xz
Update tunnel connections
Add support for IPv6 and improve debug output.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/connections/tunnel8
-rw-r--r--src/lib/connections/tuntap6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/connections/tunnel b/src/lib/connections/tunnel
index 9ed2383..6f35793 100644
--- a/src/lib/connections/tunnel
+++ b/src/lib/connections/tunnel
@@ -6,13 +6,15 @@
BindsToInterfaces=("${BindsToInterfaces[@]}")
tunnel_up() {
+ local family="-4"
if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists"
return 1
fi
- ip tunnel add "$Interface" mode "$Mode" remote "$Remote" \
- ${Local+local "$Local"}
+ [[ $Mode == *ip6* || $Mode == "any" ]] && family="-6"
+ do_debug ip "$family" tunnel add "$Interface" mode "$Mode" \
+ remote "$Remote" ${Local+local "$Local"} || return
bring_interface_up "$Interface"
ip_set
@@ -21,7 +23,7 @@ tunnel_up() {
tunnel_down() {
ip_unset
bring_interface_down "$Interface"
- ip tunnel del "$Interface"
+ ip tunnel delete "$Interface"
}
diff --git a/src/lib/connections/tuntap b/src/lib/connections/tuntap
index 0191ae0..0bf53cc 100644
--- a/src/lib/connections/tuntap
+++ b/src/lib/connections/tuntap
@@ -11,8 +11,8 @@ tuntap_up() {
return 1
fi
- ip tuntap add dev "$Interface" mode "$Mode" \
- ${User:+user "$User"} ${Group:+group "$Group"}
+ do_debug ip tuntap add dev "$Interface" mode "$Mode" \
+ ${User:+user "$User"} ${Group:+group "$Group"} || return
bring_interface_up "$Interface"
IP=${IP-no} ip_set
@@ -21,7 +21,7 @@ tuntap_up() {
tuntap_down() {
ip_unset
bring_interface_down "$Interface"
- ip tuntap del dev "$Interface" mode "$Mode"
+ ip tuntap delete dev "$Interface" mode "$Mode"
}