From 0c85a0d981c403a438e671af510a733a319b1b97 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Mon, 21 Oct 2013 15:11:39 +0200 Subject: Specify the local side of a tunnel early (FS#36711) Needed in case the remote side of a tunnel is set to 'any'. --- src/lib/connections/tunnel | 7 ++----- src/lib/connections/tuntap | 7 ++++--- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/lib/connections') 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 } -- cgit v1.2.3-24-g4f1b