luci-proto-vxlan: correctness fixes

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
Paul Donald
2026-05-26 12:49:54 +03:00
parent 1c26902888
commit 04063aed3a
2 changed files with 11 additions and 11 deletions
@@ -127,7 +127,7 @@ return network.registerProtocol('vxlan', {
o = s.taboption('general', form.Value, 'vid', _('VXLAN network identifier'), o = s.taboption('general', form.Value, 'vid', _('VXLAN network identifier'),
_('VNI') + ': ' + _('ID used to identify the VXLAN uniquely')); _('VNI') + ': ' + _('ID used to identify the VXLAN uniquely'));
o.optional = true; o.optional = true;
o.datatype = 'range(1, 16777216)'; o.datatype = 'range(1, 16777215)';
o = s.taboption('general', widgets.NetworkSelect, 'tunlink', _('Bind interface'), _('Bind the tunnel to this interface (optional).')); o = s.taboption('general', widgets.NetworkSelect, 'tunlink', _('Bind interface'), _('Bind the tunnel to this interface (optional).'));
o.exclude = s.section; o.exclude = s.section;
@@ -198,7 +198,7 @@ return network.registerProtocol('vxlan', {
o.datatype = 'string'; o.datatype = 'string';
o.optional = true; o.optional = true;
o = ss.option(form.Value, 'lladr', _('Layer 2 Address'), o = ss.option(form.Value, 'lladdr', _('Layer 2 Address'),
_('L2 (MAC) address of peer. Uses source-address learning when %s is specified') _('L2 (MAC) address of peer. Uses source-address learning when %s is specified')
.format('<code>00:00:00:00:00:00</code>')); .format('<code>00:00:00:00:00:00</code>'));
o.editable = true; o.editable = true;
@@ -245,12 +245,12 @@ return network.registerProtocol('vxlan', {
o = ss.option(form.Value, 'vni', _('VNI'), _('the VXLAN Network Identifier (or VXLAN Segment ID) to use to connect to the remote VXLAN tunnel endpoint')); o = ss.option(form.Value, 'vni', _('VNI'), _('the VXLAN Network Identifier (or VXLAN Segment ID) to use to connect to the remote VXLAN tunnel endpoint'));
o.editable = true; o.editable = true;
o.datatype = 'range(1, 16777216)'; o.datatype = 'range(1, 16777215)';
o.optional = true; o.optional = true;
o = ss.option(form.Value, 'src_vni', _('Source VNI'), _('the source VNI Network Identifier (or VXLAN Segment ID) this entry belongs to. Used only when the VXLAN device is in external or collect metadata mode ')); o = ss.option(form.Value, 'src_vni', _('Source VNI'), _('the source VNI Network Identifier (or VXLAN Segment ID) this entry belongs to. Used only when the VXLAN device is in external or collect metadata mode '));
o.editable = true; o.editable = true;
o.datatype = 'range(1, 16777216)'; o.datatype = 'range(1, 16777215)';
o.optional = true; o.optional = true;
} }
@@ -94,8 +94,8 @@ return network.registerProtocol('vxlan6', {
o.datatype = 'min(1)'; o.datatype = 'min(1)';
o = s.taboption('general', form.Flag, 'learning', _('Learning'), o = s.taboption('general', form.Flag, 'learning', _('Learning'),
_('Automatic mac learning using multicast; inserts unknown source link layer addresses and IP addresses into the VXLAN device %s' _('Automatic mac learning using multicast; inserts unknown source link layer addresses and IP addresses into the VXLAN device %s')
.format('<abbr title="%s">%s</abbr>'.format(_('Forwarding DataBase'), _('FDB'))))); .format('<abbr title="%s">%s</abbr>'.format(_('Forwarding DataBase'), _('FDB'))));
o.optional = true; o.optional = true;
o.default = '1'; o.default = '1';
o.rmempty = false; o.rmempty = false;
@@ -127,7 +127,7 @@ return network.registerProtocol('vxlan6', {
o = s.taboption('general', form.Value, 'vid', _('VXLAN network identifier'), o = s.taboption('general', form.Value, 'vid', _('VXLAN network identifier'),
_('VNI') + ': ' + _('ID used to identify the VXLAN uniquely')); _('VNI') + ': ' + _('ID used to identify the VXLAN uniquely'));
o.optional = true; o.optional = true;
o.datatype = 'range(1, 16777216)'; o.datatype = 'range(1, 16777215)';
o = s.taboption('general', widgets.NetworkSelect, 'tunlink', _('Bind interface'), _('Bind the tunnel to this interface (optional).')); o = s.taboption('general', widgets.NetworkSelect, 'tunlink', _('Bind interface'), _('Bind the tunnel to this interface (optional).'));
o.exclude = s.section; o.exclude = s.section;
@@ -198,7 +198,7 @@ return network.registerProtocol('vxlan6', {
o.datatype = 'string'; o.datatype = 'string';
o.optional = true; o.optional = true;
o = ss.option(form.Value, 'lladr', _('Layer 2 Address'), o = ss.option(form.Value, 'lladdr', _('Layer 2 Address'),
_('L2 (MAC) address of peer. Uses source-address learning when %s is specified') _('L2 (MAC) address of peer. Uses source-address learning when %s is specified')
.format('<code>00:00:00:00:00:00</code>')); .format('<code>00:00:00:00:00:00</code>'));
o.editable = true; o.editable = true;
@@ -238,19 +238,19 @@ return network.registerProtocol('vxlan6', {
let isMulticastIP = ipv4MulticastRegex.test(dst) || ipv6MulticastRegex.test(dst); let isMulticastIP = ipv4MulticastRegex.test(dst) || ipv6MulticastRegex.test(dst);
if (!value && isMulticastIP) { if (!value && isMulticastIP) {
return _('Via shall be specified when %s is a multicast address'.format(_('Peer IP'))); return _('Via shall be specified when %s is a multicast address').format(_('Peer IP'));
} }
return true; return true;
}; };
o = ss.option(form.Value, 'vni', _('VNI'), _('the VXLAN Network Identifier (or VXLAN Segment ID) to use to connect to the remote VXLAN tunnel endpoint')); o = ss.option(form.Value, 'vni', _('VNI'), _('the VXLAN Network Identifier (or VXLAN Segment ID) to use to connect to the remote VXLAN tunnel endpoint'));
o.editable = true; o.editable = true;
o.datatype = 'range(1, 16777216)'; o.datatype = 'range(1, 16777215)';
o.optional = true; o.optional = true;
o = ss.option(form.Value, 'src_vni', _('Source VNI'), _('the source VNI Network Identifier (or VXLAN Segment ID) this entry belongs to. Used only when the VXLAN device is in external or collect metadata mode ')); o = ss.option(form.Value, 'src_vni', _('Source VNI'), _('the source VNI Network Identifier (or VXLAN Segment ID) this entry belongs to. Used only when the VXLAN device is in external or collect metadata mode '));
o.editable = true; o.editable = true;
o.datatype = 'range(1, 16777216)'; o.datatype = 'range(1, 16777215)';
o.optional = true; o.optional = true;
} }