From e33e4566e36f4e4f4f7539d5dec027a60bcafc58 Mon Sep 17 00:00:00 2001 From: Monviech Date: Sat, 30 Nov 2024 15:25:18 +0000 Subject: [PATCH 1/7] net/mdns-repeater: Modernize plugin code; Add blacklist support (contributed by Kodehyrden) --- net/mdns-repeater/pkg-descr | 5 + .../etc/inc/plugins.inc.d/mdnsrepeater.inc | 102 ++++++++-------- .../MDNSRepeater/Api/ServiceController.php | 53 ++------ .../OPNsense/MDNSRepeater/forms/general.xml | 8 ++ .../OPNsense/MDNSRepeater/MDNSRepeater.xml | 8 ++ .../views/OPNsense/MDNSRepeater/index.volt | 114 ++++++++++-------- .../conf/actions.d/actions_mdnsrepeater.conf | 5 - .../OPNsense/MDNSRepeater/mdnsrepeater | 8 +- 8 files changed, 150 insertions(+), 153 deletions(-) diff --git a/net/mdns-repeater/pkg-descr b/net/mdns-repeater/pkg-descr index a5ed7facd2..93da789789 100644 --- a/net/mdns-repeater/pkg-descr +++ b/net/mdns-repeater/pkg-descr @@ -7,6 +7,11 @@ It can be used to bridge zeroconf devices to work properly across the two subnet Plugin Changelog ================ +1.2 + +* modernize plugin code +* blacklist support (contributed by Kodehyrden) + 1.1 * CARP support (contributed by Markus Reiter) diff --git a/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc b/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc index 6990e232fb..bd19d6803f 100644 --- a/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc +++ b/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc @@ -1,63 +1,65 @@ enabled == '1'; -} + * Copyright © 2017 Fabian Franz + * Copyright (c) 2024 Cedrik Pischem + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ -function mdnsrepeater_firewall($fw) +function mdnsrepeater_services() { - if (!mdnsrepeater_enabled()) { - return; + global $config; + + $services = []; + + if (isset($config['OPNsense']['MDNSRepeater']['enabled']) && + $config['OPNsense']['MDNSRepeater']['enabled'] == '1') { + $services[] = [ + 'description' => gettext('mDNS Repeater'), + 'configd' => [ + 'start' => ['mdnsrepeater start'], + 'restart' => ['mdnsrepeater restart'], + 'stop' => ['mdnsrepeater stop'], + ], + 'name' => 'mdns-repeater', + 'pidfile' => '/var/run/mdns-repeater.pid', + ]; } + + return $services; } -function mdnsrepeater_services() +function mdnsrepeater_xmlrpc_sync() { - $services = array(); + $result = []; - // don't load the service if it is not enabled - // maybe there are no settings yet - if (!mdnsrepeater_enabled()) { - return $services; - } - - $services[] = array( + $result[] = [ 'description' => gettext('mDNS Repeater'), - 'configd' => array( - 'restart' => array('mdnsrepeater restart'), - 'start' => array('mdnsrepeater start'), - 'stop' => array('mdnsrepeater stop'), - ), - 'name' => 'mdns-repeater', - ); + 'section' => 'OPNsense.MDNSRepeater', + 'id' => 'mdns-repeater', + 'services' => ['mdns-repeater'], + ]; - return $services; + return $result; } diff --git a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/Api/ServiceController.php b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/Api/ServiceController.php index 1d5637292f..f109dd8a32 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/Api/ServiceController.php +++ b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/Api/ServiceController.php @@ -2,6 +2,7 @@ /** * Copyright (C) 2017 Fabian Franz + * Copyright (C) 2024 Cedrik Pischem * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,52 +29,12 @@ namespace OPNsense\MDNSRepeater\Api; -use OPNsense\Base\ApiControllerBase; -use OPNsense\Core\Backend; -use OPNsense\MDNSRepeater\MDNSRepeater; +use OPNsense\Base\ApiMutableServiceControllerBase; -class ServiceController extends ApiControllerBase +class ServiceController extends ApiMutableServiceControllerBase { - public function statusAction() - { - $backend = new Backend(); - $result = array('result' => 'failed'); - $res = $backend->configdRun('mdnsrepeater status'); - if (stripos($res, 'is running')) { - $result['result'] = 'running'; - } elseif (stripos($res, 'not running')) { - $general = new MDNSRepeater(); - if ((string)$general->enabled == '1') { - $result['result'] = 'stopped'; - } else { - $result['result'] = 'disabled'; - } - } else { - $result['message'] = $res; - } - return $result; - } - - public function startAction() - { - $backend = new Backend(); - $result = array('result' => 'failed'); - $backend->configdRun('template reload OPNsense/MDNSRepeater'); - $result['result'] = $backend->configdRun('mdnsrepeater start'); - return $result; - } - - public function stopAction() - { - $backend = new Backend(); - $result = array("result" => "failed"); - $result['result'] = $backend->configdRun('mdnsrepeater stop'); - return $result; - } - - public function restartAction() - { - $this->stopAction(); - return $this->startAction(); - } + protected static $internalServiceClass = '\OPNsense\MDNSRepeater\MDNSRepeater'; + protected static $internalServiceTemplate = 'OPNsense/MDNSRepeater'; + protected static $internalServiceEnabled = 'enabled'; + protected static $internalServiceName = 'mdnsrepeater'; } diff --git a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml index 7a565757fe..1c6de8a3de 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml @@ -17,4 +17,12 @@ select_multiple At least 2 interfaces must be selected. The maximum number of supported interfaces by the daemon is 5. + + mdnsrepeater.blacklist + + select_multiple + + true + Enter up to 16 client IPv4 addresses including subnet or networks to be exluded. + diff --git a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml index 85015e3d67..5d67b005fb 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml @@ -16,5 +16,13 @@ Y Y + + Y + ipv4 + , + N + Y + Only valid IPv4 networks or individual addresses including subnet are allowed. + diff --git a/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt b/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt index 014decb92c..fbb2b1575a 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt +++ b/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt @@ -1,63 +1,75 @@ {# - -Copyright © 2017 Fabian Franz -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -#} + # Copyright © 2017 Fabian Franz + # Copyright (c) 2024 Cedrik Pischem + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without modification, + # are permitted provided that the following conditions are met: + # + # 1. Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # + # 2. Redistributions in binary form must reproduce the above copyright notice, + # this list of conditions and the following disclaimer in the documentation + # and/or other materials provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + #} -
- {{ partial("layout_partials/base_form",['fields': general,'id':'general'])}} -
-
- +
+
+ {{ partial("layout_partials/base_form", ['fields': general, 'id': 'frm_GeneralSettings']) }} +
+
+
+
+
+ +

+
-
+ diff --git a/net/mdns-repeater/src/opnsense/service/conf/actions.d/actions_mdnsrepeater.conf b/net/mdns-repeater/src/opnsense/service/conf/actions.d/actions_mdnsrepeater.conf index 16ef2c5c5f..6372ffde18 100644 --- a/net/mdns-repeater/src/opnsense/service/conf/actions.d/actions_mdnsrepeater.conf +++ b/net/mdns-repeater/src/opnsense/service/conf/actions.d/actions_mdnsrepeater.conf @@ -17,8 +17,3 @@ message:mdns-repeater status command:service mdns-repeater restart type:script message:restarting mdns-repeater - -[reload] -command:service mdns-repeater reload -type:script -message:reload mdns-repeater diff --git a/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater b/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater index 7ca779ca55..cada947968 100644 --- a/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater +++ b/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater @@ -9,7 +9,13 @@ required_files="/var/run/mdns-repeater.CARP_MASTER" {% for i in osifnames %} {% do interface_list.append(physical_interface(i)) %} {% endfor %} -mdns_repeater_interfaces="{{ interface_list | join(' ') }}" +{% set repeater_interfaces = interface_list | join(' ') %} +{% if helpers.exists('OPNsense.MDNSRepeater.blacklist') and OPNsense.MDNSRepeater.blacklist != '' %} +{% set blacklist_and_repeater_interfaces = "-b " + OPNsense.MDNSRepeater.blacklist.split(',') | join(' -b ') + " " + repeater_interfaces %} +mdns_repeater_interfaces="{{ blacklist_and_repeater_interfaces }}" +{% else %} +mdns_repeater_interfaces="{{ repeater_interfaces }}" +{% endif %} {% else %} mdns_repeater_enable="NO" {% endif %} From 4c568fa2d8c55926f1679dbfc69d1c18b8c22896 Mon Sep 17 00:00:00 2001 From: Monviech Date: Sat, 30 Nov 2024 15:27:01 +0000 Subject: [PATCH 2/7] net/mdns-repeater: bump version --- net/mdns-repeater/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mdns-repeater/Makefile b/net/mdns-repeater/Makefile index 8fc5683f4a..c2d785a2de 100644 --- a/net/mdns-repeater/Makefile +++ b/net/mdns-repeater/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= mdns-repeater -PLUGIN_VERSION= 1.1 +PLUGIN_VERSION= 1.2 PLUGIN_REVISION= 1 PLUGIN_COMMENT= Proxy multicast DNS between networks PLUGIN_MAINTAINER= franz.fabian.94@gmail.com From d38a81fb77cf073d4ead754310d4afaee33fc854 Mon Sep 17 00:00:00 2001 From: Monviech Date: Sat, 30 Nov 2024 18:27:18 +0000 Subject: [PATCH 3/7] net/mdns-repeater: fix indentation of model and form --- net/mdns-repeater/Makefile | 1 - .../OPNsense/MDNSRepeater/forms/general.xml | 56 ++++++++++--------- .../OPNsense/MDNSRepeater/MDNSRepeater.xml | 52 ++++++++--------- 3 files changed, 56 insertions(+), 53 deletions(-) diff --git a/net/mdns-repeater/Makefile b/net/mdns-repeater/Makefile index c2d785a2de..35f45dfb85 100644 --- a/net/mdns-repeater/Makefile +++ b/net/mdns-repeater/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= mdns-repeater PLUGIN_VERSION= 1.2 -PLUGIN_REVISION= 1 PLUGIN_COMMENT= Proxy multicast DNS between networks PLUGIN_MAINTAINER= franz.fabian.94@gmail.com PLUGIN_DEPENDS= mdns-repeater diff --git a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml index 1c6de8a3de..1c7d2f1869 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml @@ -1,28 +1,32 @@
- - mdnsrepeater.enabled - - checkbox - Enable the repeater. - - - mdnsrepeater.enablecarp - - checkbox - This will activate the repeater service only on the master device. - - - mdnsrepeater.interfaces - - select_multiple - At least 2 interfaces must be selected. The maximum number of supported interfaces by the daemon is 5. - - - mdnsrepeater.blacklist - - select_multiple - - true - Enter up to 16 client IPv4 addresses including subnet or networks to be exluded. - + + header + + + + mdnsrepeater.enabled + + checkbox + Enable the repeater. + + + mdnsrepeater.enablecarp + + checkbox + This will activate the repeater service only on the master device. + + + mdnsrepeater.interfaces + + select_multiple + At least 2 interfaces must be selected. The maximum number of supported interfaces by the daemon is 5. + + + mdnsrepeater.blacklist + + select_multiple + + true + Enter up to 16 client IPv4 addresses including subnet or networks to be exluded. +
diff --git a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml index 5d67b005fb..8019e0371d 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml @@ -1,28 +1,28 @@ - //OPNsense/MDNSRepeater - 1.0.1 - mdns-repeater settings - - - 0 - Y - - - 0 - Y - - - lan - Y - Y - - - Y - ipv4 - , - N - Y - Only valid IPv4 networks or individual addresses including subnet are allowed. - - + //OPNsense/MDNSRepeater + 1.0.1 + mdns-repeater settings + + + 0 + Y + + + 0 + Y + + + lan + Y + Y + + + Y + ipv4 + , + N + Y + Only valid IPv4 networks or individual addresses including subnet are allowed. + + From 56ad0637645679729ff4024ebe89f1ceb1f1122e Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:19:18 +0100 Subject: [PATCH 4/7] Update net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc Co-authored-by: Franco Fichtner --- net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc b/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc index bd19d6803f..9d51f61d97 100644 --- a/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc +++ b/net/mdns-repeater/src/etc/inc/plugins.inc.d/mdnsrepeater.inc @@ -1,7 +1,7 @@ Date: Thu, 5 Dec 2024 14:19:25 +0100 Subject: [PATCH 5/7] Update net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt Co-authored-by: Franco Fichtner --- .../src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt b/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt index fbb2b1575a..639ff6f3b9 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt +++ b/net/mdns-repeater/src/opnsense/mvc/app/views/OPNsense/MDNSRepeater/index.volt @@ -1,5 +1,5 @@ {# - # Copyright © 2017 Fabian Franz + # Copyright (c) 2017 Fabian Franz # Copyright (c) 2024 Cedrik Pischem # All rights reserved. # From e8c2ac30fb288349202836519daca0c2d152a9bc Mon Sep 17 00:00:00 2001 From: Monviech <79600909+Monviech@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:19:30 +0100 Subject: [PATCH 6/7] Update net/mdns-repeater/pkg-descr Co-authored-by: Franco Fichtner --- net/mdns-repeater/pkg-descr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mdns-repeater/pkg-descr b/net/mdns-repeater/pkg-descr index 93da789789..c67d64e00a 100644 --- a/net/mdns-repeater/pkg-descr +++ b/net/mdns-repeater/pkg-descr @@ -10,7 +10,7 @@ Plugin Changelog 1.2 * modernize plugin code -* blacklist support (contributed by Kodehyrden) +* blocklist support (contributed by Kodehyrden) 1.1 From 6b7da7a09c815b4ba6afa2ffc61374fd5f146302 Mon Sep 17 00:00:00 2001 From: Monviech Date: Fri, 6 Dec 2024 14:41:07 +0000 Subject: [PATCH 7/7] net/mdnsrepeater: Change blacklist to blocklist --- .../app/controllers/OPNsense/MDNSRepeater/forms/general.xml | 4 ++-- .../mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml | 4 ++-- .../service/templates/OPNsense/MDNSRepeater/mdnsrepeater | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml index 1c7d2f1869..4f6ba145ba 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/controllers/OPNsense/MDNSRepeater/forms/general.xml @@ -22,8 +22,8 @@ At least 2 interfaces must be selected. The maximum number of supported interfaces by the daemon is 5. - mdnsrepeater.blacklist - + mdnsrepeater.blocklist + select_multiple true diff --git a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml index 8019e0371d..e5e868d550 100644 --- a/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml +++ b/net/mdns-repeater/src/opnsense/mvc/app/models/OPNsense/MDNSRepeater/MDNSRepeater.xml @@ -16,13 +16,13 @@ Y Y - + Y ipv4 , N Y Only valid IPv4 networks or individual addresses including subnet are allowed. - + diff --git a/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater b/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater index cada947968..7d397003e1 100644 --- a/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater +++ b/net/mdns-repeater/src/opnsense/service/templates/OPNsense/MDNSRepeater/mdnsrepeater @@ -10,9 +10,9 @@ required_files="/var/run/mdns-repeater.CARP_MASTER" {% do interface_list.append(physical_interface(i)) %} {% endfor %} {% set repeater_interfaces = interface_list | join(' ') %} -{% if helpers.exists('OPNsense.MDNSRepeater.blacklist') and OPNsense.MDNSRepeater.blacklist != '' %} -{% set blacklist_and_repeater_interfaces = "-b " + OPNsense.MDNSRepeater.blacklist.split(',') | join(' -b ') + " " + repeater_interfaces %} -mdns_repeater_interfaces="{{ blacklist_and_repeater_interfaces }}" +{% if helpers.exists('OPNsense.MDNSRepeater.blocklist') and OPNsense.MDNSRepeater.blocklist != '' %} +{% set blocklist_and_repeater_interfaces = "-b " + OPNsense.MDNSRepeater.blocklist.split(',') | join(' -b ') + " " + repeater_interfaces %} +mdns_repeater_interfaces="{{ blocklist_and_repeater_interfaces }}" {% else %} mdns_repeater_interfaces="{{ repeater_interfaces }}" {% endif %}