Skip to content

Commit

Permalink
luci-app-firewall: add address range inputs for traffic rules
Browse files Browse the repository at this point in the history
Ref: https://forum.openwrt.org/t/question-about-firewall-rules/188656
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Feb 21, 2024
1 parent cf09f89 commit 42bd2af
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'require form';
'require network';
'require firewall';
'require validation';
'require tools.prng as random';

var protocols = [
Expand Down Expand Up @@ -455,9 +456,10 @@ return baseclass.extend({

addIPOption: function(s, tab, name, label, description, family, hosts, multiple) {
var o = s.taboption(tab, multiple ? this.CBIDynamicMultiValueList : form.Value, name, label, description);
var fw4 = L.hasSystemFeature('firewall4');

o.modalonly = true;
o.datatype = 'list(neg(ipmask("true")))';
o.datatype = (fw4 && validation.types.iprange) ? 'list(neg(or(ipmask("true"),iprange)))' : 'list(neg(ipmask("true")))';
o.placeholder = multiple ? _('-- add IP --') : _('any');

if (family != null) {
Expand Down

0 comments on commit 42bd2af

Please sign in to comment.