From 21818b3a0d7f1924a34b1cc5f3b211419b40ad11 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 2 Jul 2026 14:41:20 +0200 Subject: [PATCH] luci-proto-xfrm: replace ifid datatype check with range check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to the documentation, values from '1' to '4294967295' are allowed values for the 'ifid' option. The value ‘0’ is excluded, as '0' is treated as the default ID or an unassigned ID. While we’re at it, mark the option as non-optional. Signed-off-by: Florian Eckert --- .../htdocs/luci-static/resources/protocol/xfrm.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocols/luci-proto-xfrm/htdocs/luci-static/resources/protocol/xfrm.js b/protocols/luci-proto-xfrm/htdocs/luci-static/resources/protocol/xfrm.js index 2e2fb97ea5..40a2d746d4 100644 --- a/protocols/luci-proto-xfrm/htdocs/luci-static/resources/protocol/xfrm.js +++ b/protocols/luci-proto-xfrm/htdocs/luci-static/resources/protocol/xfrm.js @@ -37,7 +37,8 @@ return network.registerProtocol('xfrm', { var o, ss; o = s.taboption('general', form.Value, 'ifid', _('Interface ID'), _('Required. XFRM interface ID to be used for SA.')); - o.datatype = 'integer'; + o.datatype = 'range(1,4294967295)'; + o.rmempty = false; o = s.taboption('general', widgets.NetworkSelect, 'tunlink', _('Underlying interface'),_('Optional. Bind to a specific interface.')); o.exclude = s.section;