From c3db6905c3e33ca6dacd3fc8c6e7ea2e70119bd8 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 1 Mar 2021 15:18:25 +0100 Subject: [PATCH] luci-app-firewall: allow negative prefix lengths Fixes: #4812 Signed-off-by: Jo-Philipp Wich (cherry picked from commit f64b3d509446cc78a7df746b174bdab330f23ab2) --- .../htdocs/luci-static/resources/tools/firewall.js | 2 +- .../htdocs/luci-static/resources/view/firewall/forwards.js | 4 ++-- .../htdocs/luci-static/resources/view/firewall/snats.js | 4 ++-- .../htdocs/luci-static/resources/view/firewall/zones.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js index 7a04d26c9d..ec6aa82cd1 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js @@ -444,7 +444,7 @@ return baseclass.extend({ var o = s.taboption(tab, multiple ? this.CBIDynamicMultiValueList : form.Value, name, label, description); o.modalonly = true; - o.datatype = 'list(neg(ipmask))'; + o.datatype = 'list(neg(ipmask("true")))'; o.placeholder = multiple ? _('-- add IP --') : _('any'); if (family != null) { diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js index 82703c320e..1c8c806562 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js @@ -201,7 +201,7 @@ return view.extend({ o = fwtool.addIPOption(s, 'advanced', 'src_ip', _('Source IP address'), _('Only match incoming traffic from this IP or range.'), 'ipv4', hosts); o.rmempty = true; - o.datatype = 'neg(ipmask4)'; + o.datatype = 'neg(ipmask4("true"))'; o = s.taboption('advanced', form.Value, 'src_port', _('Source port'), _('Only match incoming traffic originating from the given source port or port range on the client host')); @@ -214,7 +214,7 @@ return view.extend({ o = fwtool.addLocalIPOption(s, 'advanced', 'src_dip', _('External IP address'), _('Only match incoming traffic directed at the given IP address.'), devs); - o.datatype = 'neg(ipmask4)'; + o.datatype = 'neg(ipmask4("true"))'; o.rmempty = true; o = s.taboption('general', form.Value, 'src_dport', _('External port'), diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js index 859dba3e88..1d6e01c1a8 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js @@ -180,7 +180,7 @@ return view.extend({ o = fwtool.addIPOption(s, 'general', 'src_ip', _('Source address'), _('Match forwarded traffic from this IP or range.'), 'ipv4', hosts); o.rmempty = true; - o.datatype = 'neg(ipmask4)'; + o.datatype = 'neg(ipmask4("true"))'; o = s.taboption('general', form.Value, 'src_port', _('Source port'), _('Match forwarded traffic originating from the given source port or port range.')); @@ -194,7 +194,7 @@ return view.extend({ o = fwtool.addIPOption(s, 'general', 'dest_ip', _('Destination address'), _('Match forwarded traffic directed at the given IP address.'), 'ipv4', hosts); o.rmempty = true; - o.datatype = 'neg(ipmask4)'; + o.datatype = 'neg(ipmask4("true"))'; o = s.taboption('general', form.Value, 'dest_port', _('Destination port'), _('Match forwarded traffic directed at the given destination port or port range.')); diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js index 8a9b1b4bcd..cdca218adc 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js @@ -216,7 +216,7 @@ return view.extend({ o.multiple = true; o = s.taboption('advanced', form.DynamicList, 'subnet', _('Covered subnets'), _('Use this option to classify zone traffic by source or destination subnet instead of networks or devices.')); - o.datatype = 'neg(cidr)'; + o.datatype = 'neg(cidr("true"))'; o.modalonly = true; o.multiple = true; -- 2.30.2