summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2013-10-21 15:11:39 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2013-10-21 15:11:39 +0200
commit0c85a0d981c403a438e671af510a733a319b1b97 (patch)
treef8eb17d57c57aaf5aa8e7ee7592a6ce0fdb385df
parent127976c75b294865571c3367f3d8e2e25262f2e7 (diff)
downloadnetctl-0c85a0d981c403a438e671af510a733a319b1b97.tar.gz
netctl-0c85a0d981c403a438e671af510a733a319b1b97.tar.xz
Specify the local side of a tunnel early (FS#36711)
Needed in case the remote side of a tunnel is set to 'any'.
-rw-r--r--src/lib/connections/tunnel7
-rw-r--r--src/lib/connections/tuntap7
2 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/connections/tunnel b/src/lib/connections/tunnel
index a14f96e..ab62cc7 100644
--- a/src/lib/connections/tunnel
+++ b/src/lib/connections/tunnel
@@ -8,13 +8,10 @@ tunnel_up() {
if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists"
return 1
- else
- ip tunnel add "$Interface" mode "$Mode" remote "$Remote"
fi
- if [[ -n "$Local" ]]; then
- ip tunnel change "$Interface" local "$Local"
- fi
+ ip tunnel add "$Interface" mode "$Mode" remote "$Remote" \
+ ${Local+local "$Local"}
bring_interface_up "$Interface"
ip_set
diff --git a/src/lib/connections/tuntap b/src/lib/connections/tuntap
index 149c842..2c00839 100644
--- a/src/lib/connections/tuntap
+++ b/src/lib/connections/tuntap
@@ -8,10 +8,11 @@ tuntap_up() {
if is_interface "$Interface"; then
report_error "Interface '$Interface' already exists"
return 1
- else
- ip tuntap add dev "$Interface" mode "$Mode" \
- ${User:+user "$User"} ${Group:+group "$Group"}
fi
+
+ ip tuntap add dev "$Interface" mode "$Mode" \
+ ${User:+user "$User"} ${Group:+group "$Group"}
+
bring_interface_up "$Interface"
IP=${IP-no} ip_set
}