diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-01-16 18:16:55 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-16 18:17:09 +0100 |
commit | cdf240f0a08aa72767adb162230a048f3445fa6c (patch) | |
tree | c1a431b73dbeb5dd8032c7f09262ef418640de06 /applications | |
parent | aca2c4ba4e4c847e5ae86e5539537f213678a0f3 (diff) |
luci-app-firewall: support 'mark' parameter for redirects
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js | 16 |
1 files changed, 16 insertions, 0 deletions
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 49c8cd75f..030b78b2d 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 @@ -299,6 +299,22 @@ return L.view.extend({ return _('Unknown or not installed conntrack helper "%s"').format(value); }; + o = s.taboption('advanced', form.Value, 'mark', _('Match mark'), + _('Matches a specific firewall mark or a range of different marks.')); + o.modalonly = true; + o.rmempty = true; + o.validate = function(section_id, value) { + if (value == '') + return true; + + var m = String(value).match(/^(?:!\s*)?(0x[0-9a-f]{1,8}|[0-9]{1,10})(?:\/(0x[0-9a-f]{1,8}|[0-9]{1,10}))?$/i); + + if (!m || +m[1] > 0xffffffff || (m[2] != null && +m[2] > 0xffffffff)) + return _('Expecting: %s').format(_('valid firewall mark')); + + return true; + }; + o = s.taboption('advanced', form.Value, 'extra', _('Extra arguments'), _('Passes additional arguments to iptables. Use with care!')); o.modalonly = true; |