mirror of
https://github.com/openwrt/luci.git
synced 2026-04-15 10:51:51 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user