luci-app-firewall: allow negative prefix lengths

Fixes: #4812
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f64b3d5094)
This commit is contained in:
Jo-Philipp Wich 2021-03-01 15:18:25 +01:00
parent bd39e6abaf
commit 493552552f
4 changed files with 6 additions and 6 deletions

View file

@ -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) {

View file

@ -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'),

View file

@ -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.'));

View file

@ -224,7 +224,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;