From 70ec0382f26eb016f4bcd6dd4f26f2c3045b8d08 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 19 Feb 2017 13:40:28 +0100 Subject: [PATCH] (tinc) add mode option (cherry picked from commit 9af4e92996f7e475b0629bec87e12f1a94ad7400) (cherry picked from commit 0adcbdce9cf3c8e36f46d886c4625157fbc73117) --- security/tinc/Makefile | 3 +-- .../controllers/OPNsense/Tinc/forms/dialogNetwork.xml | 7 +++++++ .../src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml | 10 +++++++++- .../src/opnsense/scripts/OPNsense/Tinc/lib/objects.py | 2 ++ .../service/templates/OPNsense/Tinc/tinc_deploy.xml | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/security/tinc/Makefile b/security/tinc/Makefile index 0f0879f02..0c4a40ed6 100644 --- a/security/tinc/Makefile +++ b/security/tinc/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= tinc -PLUGIN_VERSION= 1.1 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.2 PLUGIN_COMMENT= Tinc VPN PLUGIN_DEPENDS= tinc PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml index 5b9dfb05a..8f1e81f20 100644 --- a/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml +++ b/security/tinc/src/opnsense/mvc/app/controllers/OPNsense/Tinc/forms/dialogNetwork.xml @@ -5,6 +5,13 @@ checkbox Enable this network + + network.mode + + dropdown + true + This option selects the way packets are routed to other daemons + network.name diff --git a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml index 466f37b62..b54455a8a 100644 --- a/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml +++ b/security/tinc/src/opnsense/mvc/app/models/OPNsense/Tinc/Tinc.xml @@ -1,6 +1,6 @@ //OPNsense/Tinc - 1.0.0 + 1.0.1 OPNsense Tinc VPN @@ -62,6 +62,14 @@ /tmp/tinc_current_cipher_options.index aes-256-cbc + + Y + router + + router + switch + + 1 Y diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py index 55c6e34d6..9c52cc875 100644 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/lib/objects.py @@ -62,6 +62,7 @@ class Network(NetwConfObject): self._payload['privkey'] = None self._payload['intaddress'] = None self._payload['debuglevel'] = 'd0' + self._payload['mode'] = 'switch' self._hosts = list() def get_id(self): @@ -86,6 +87,7 @@ class Network(NetwConfObject): def config_text(self): result = list() result.append('AddressFamily=any') + result.append('Mode=%(mode)s' % self._payload) result.append('Port=%(port)s' % self._payload) result.append('PingTimeout=%(pingtimeout)s' % self._payload) for host in self._hosts: diff --git a/security/tinc/src/opnsense/service/templates/OPNsense/Tinc/tinc_deploy.xml b/security/tinc/src/opnsense/service/templates/OPNsense/Tinc/tinc_deploy.xml index 0d7687207..440afed75 100644 --- a/security/tinc/src/opnsense/service/templates/OPNsense/Tinc/tinc_deploy.xml +++ b/security/tinc/src/opnsense/service/templates/OPNsense/Tinc/tinc_deploy.xml @@ -4,6 +4,7 @@ {% if network.enabled|default('0') == '1' %} {{network.id}} + {{network.mode}} {{network.hostname}} {{network.name}} {{network.intaddress}}