[pve-devel] [PATCH widget-toolkit] change allowed v6 prefix-length to 128

Stoiko Ivanov s.ivanov at proxmox.com
Thu Mar 21 18:20:32 CET 2019


Currently the frontend validation only allows values 8-120 as prefix-lengths for
ipv6-cidr notations.

Following commit 70ea22506939f9687e1146c0f35247cfbe9225b8 in pve-common, this
patch changes that value to 128, which, while seldomly seen in regular setups
is technically correct.

Problem was reported by a user in the forum - they needed to set a length of
125, because their provider supplies only smaller networks. [0]

[0] https://forum.proxmox.com/threads/lxc-ipv6-why-8-120.52638/

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 Toolkit.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Toolkit.js b/Toolkit.js
index bd237df..cb37972 100644
--- a/Toolkit.js
+++ b/Toolkit.js
@@ -30,9 +30,9 @@ Ext.apply(Ext.form.field.VTypes, {
 	var result = Proxmox.Utils.IP6_cidr_match.exec(v);
 	// limits according to JSON Schema see
 	// pve-common/src/PVE/JSONSchema.pm
-	return (result !== null && result[1] >= 8 && result[1] <= 120);
+	return (result !== null && result[1] >= 8 && result[1] <= 128);
     },
-    IP6CIDRAddressText:  gettext('Example') + ': 2001:DB8::42/64' + "<br>" + gettext('Valid CIDR Range') + ': 8-120',
+    IP6CIDRAddressText:  gettext('Example') + ': 2001:DB8::42/64' + "<br>" + gettext('Valid CIDR Range') + ': 8-128',
     IP6CIDRAddressMask:  /[A-Fa-f0-9:\/]/,
 
     IP6PrefixLength:  function(v) {
-- 
2.11.0




More information about the pve-devel mailing list