summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-wireguard
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-06-02 14:35:32 -0400
committerJo-Philipp Wich <jo@mein.io>2021-06-03 09:51:58 +0200
commitbc1015f7db57506b2468846f79dbd5bfe0dbea7a (patch)
tree0d76f80d89b18881f8a821ff20990b276910fd39 /protocols/luci-proto-wireguard
parente35041e0a8edcf039d62a74cbc5e0f4043d04029 (diff)
luci-proto-wireguard: fix fwmark validation to allow 32 bit values
The iptables mark field is 32 bits wide, which is 4 bytes and so 8 hex characters. Fix the fwmark validation to allow 8 characters in the hex string. Fixes: #5098 Suggested-by: Robert <32970961+differentblue@users.noreply.github.com> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'protocols/luci-proto-wireguard')
-rw-r--r--protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
index dd933c9544..6321f85d9b 100644
--- a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
+++ b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
@@ -97,7 +97,7 @@ return network.registerProtocol('wireguard', {
o = s.taboption('advanced', form.Value, 'fwmark', _('Firewall Mark'), _('Optional. 32-bit mark for outgoing encrypted packets. Enter value in hex, starting with <code>0x</code>.'));
o.optional = true;
o.validate = function(section_id, value) {
- if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,4}$/))
+ if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,8}$/))
return _('Invalid hexadecimal value');
return true;