* [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range
@ 2026-05-12 11:21 Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-common 1/4] jsonschema: add full-range CIDR JSON schema formats Gabriel Goller
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Gabriel Goller @ 2026-05-12 11:21 UTC (permalink / raw)
To: pve-devel
This is a follow-up on the route-maps and prefix-list series by Stefan.
The goal is to extend the CIDR range on the prefix-list, making it possible to
allow prefixes such as 0.0.0.0/0, which is a classic "allow-all".
The current IP64CIDRAddress(ui)/CIDR(api) format only allows a minimum of /8 CIDR. In order
to keep it backwards compatible and avoid accidentally breaking migration or
replication, create a new format.
pve-common:
Gabriel Goller (1):
jsonschema: add full-range CIDR JSON schema formats
src/PVE/JSONSchema.pm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
pve-network:
Gabriel Goller (1):
sdn: prefix-list: allow full prefix CIDR range
src/PVE/Network/SDN/PrefixLists.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
proxmox-widget-toolkit:
Gabriel Goller (1):
toolkit: Add IP/CIDR validator with full prefix range checks
src/Toolkit.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
pve-manager:
Gabriel Goller (1):
sdn: prefix-lists: change prefix format to allow bigger subnets
www/manager6/sdn/PrefixListPanel.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Summary over all repositories:
4 files changed, 57 insertions(+), 2 deletions(-)
--
Generated by murpp 0.11.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH pve-common 1/4] jsonschema: add full-range CIDR JSON schema formats
2026-05-12 11:21 [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Gabriel Goller
@ 2026-05-12 11:21 ` Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-network 2/4] sdn: prefix-list: allow full prefix CIDR range Gabriel Goller
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Gabriel Goller @ 2026-05-12 11:21 UTC (permalink / raw)
To: pve-devel
Add IPv4, IPv6, and generic CIDR validators that allow the full
prefix range, including /0. Don't change the existing CIDR validators.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
src/PVE/JSONSchema.pm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm
index 1997c703d725..58b86874b0d6 100644
--- a/src/PVE/JSONSchema.pm
+++ b/src/PVE/JSONSchema.pm
@@ -590,6 +590,45 @@ sub pve_verify_cidr {
return $cidr;
}
+register_format('FullRangeCIDRv6', \&pve_verify_fullrangecidrv6);
+
+sub pve_verify_fullrangecidrv6 {
+ my ($cidr, $noerr) = @_;
+
+ if ($cidr =~ m!^(?:$IPV6RE)(?:/(\d+))$! && ($1 >= 0) && ($1 <= 128)) {
+ return $cidr;
+ }
+
+ return undef if $noerr;
+ die "value does not look like a valid IPv6 CIDR network\n";
+}
+
+register_format('FullRangeCIDRv4', \&pve_verify_fullrangecidrv4);
+
+sub pve_verify_fullrangecidrv4 {
+ my ($cidr, $noerr) = @_;
+
+ if ($cidr =~ m!^(?:$IPV4RE)(?:/(\d+))$! && ($1 >= 0) && ($1 <= 32)) {
+ return $cidr;
+ }
+
+ return undef if $noerr;
+ die "value does not look like a valid IPv4 CIDR network\n";
+}
+
+register_format('FullRangeCIDR', \&pve_verify_fullrangecidr);
+
+sub pve_verify_fullrangecidr {
+ my ($cidr, $noerr) = @_;
+
+ if (!(pve_verify_fullrangecidrv4($cidr, 1) || pve_verify_fullrangecidrv6($cidr, 1))) {
+ return undef if $noerr;
+ die "value does not look like a valid CIDR network\n";
+ }
+
+ return $cidr;
+}
+
register_format('pve-ipv4-config', \&pve_verify_ipv4_config);
sub pve_verify_ipv4_config {
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH pve-network 2/4] sdn: prefix-list: allow full prefix CIDR range
2026-05-12 11:21 [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-common 1/4] jsonschema: add full-range CIDR JSON schema formats Gabriel Goller
@ 2026-05-12 11:21 ` Gabriel Goller
2026-05-12 11:21 ` [PATCH proxmox-widget-toolkit 3/4] toolkit: Add IP/CIDR validator with full prefix range checks Gabriel Goller
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Gabriel Goller @ 2026-05-12 11:21 UTC (permalink / raw)
To: pve-devel
Allow the full CIDR range in the prefix-list prefix. This allows us to
use prefixes such as 0.0.0.0/0.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
src/PVE/Network/SDN/PrefixLists.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/Network/SDN/PrefixLists.pm b/src/PVE/Network/SDN/PrefixLists.pm
index 2dd7909007bb..19d752d245f0 100644
--- a/src/PVE/Network/SDN/PrefixLists.pm
+++ b/src/PVE/Network/SDN/PrefixLists.pm
@@ -116,7 +116,7 @@ sub prefix_list_entry_properties {
},
prefix => {
type => 'string',
- format => 'CIDR',
+ format => 'FullRangeCIDR',
optional => $update,
},
le => {
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH proxmox-widget-toolkit 3/4] toolkit: Add IP/CIDR validator with full prefix range checks
2026-05-12 11:21 [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-common 1/4] jsonschema: add full-range CIDR JSON schema formats Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-network 2/4] sdn: prefix-list: allow full prefix CIDR range Gabriel Goller
@ 2026-05-12 11:21 ` Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-manager 4/4] sdn: prefix-lists: change prefix format to allow bigger subnets Gabriel Goller
2026-05-12 22:09 ` [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Thomas Lamprecht
4 siblings, 0 replies; 7+ messages in thread
From: Gabriel Goller @ 2026-05-12 11:21 UTC (permalink / raw)
To: pve-devel
Introduce an IP64FullRangeCIDRAddress validator that accepts IPv4 and
IPv6 CIDR addresses with the full prefix range of 0-32 and 0-128. This
is useful when e.g. selecting a prefix on the route-map, where 0.0.0.0/0
is a valid prefix (allow-all).
To preserve backwards compatibility and not break anything, keep the old
IP64CIDRAddress (with cidr ranges 8-32, 8-128) around.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
src/Toolkit.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/Toolkit.js b/src/Toolkit.js
index c2ae90a1e65c..290ec03efaf6 100644
--- a/src/Toolkit.js
+++ b/src/Toolkit.js
@@ -65,6 +65,22 @@ Ext.apply(Ext.form.field.VTypes, {
IP64CIDRAddressText: gettext('Example') + ': 192.168.1.1/24 2001:DB8::42/64',
IP64CIDRAddressMask: /[A-Fa-f0-9.:/]/,
+ IP64FullRangeCIDRAddress: function (v) {
+ let result = Proxmox.Utils.IP64_cidr_match.exec(v);
+ if (result === null) {
+ return false;
+ }
+ if (result[1] !== undefined) {
+ return result[1] >= 0 && result[1] <= 128;
+ } else if (result[2] !== undefined) {
+ return result[2] >= 0 && result[2] <= 32;
+ } else {
+ return false;
+ }
+ },
+ IP64FullRangeCIDRAddressText: gettext('Example') + ': 192.168.1.1/24 2001:DB8::42/64',
+ IP64FullRangeCIDRAddressMask: /[A-Fa-f0-9.:/]/,
+
MacAddress: function (v) {
return /^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/.test(v);
},
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH pve-manager 4/4] sdn: prefix-lists: change prefix format to allow bigger subnets
2026-05-12 11:21 [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Gabriel Goller
` (2 preceding siblings ...)
2026-05-12 11:21 ` [PATCH proxmox-widget-toolkit 3/4] toolkit: Add IP/CIDR validator with full prefix range checks Gabriel Goller
@ 2026-05-12 11:21 ` Gabriel Goller
2026-05-12 22:09 ` [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Thomas Lamprecht
4 siblings, 0 replies; 7+ messages in thread
From: Gabriel Goller @ 2026-05-12 11:21 UTC (permalink / raw)
To: pve-devel
Change the format on the prefix-list prefix input field. This allows us
to use bigger CIDRs such as /0.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
www/manager6/sdn/PrefixListPanel.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/www/manager6/sdn/PrefixListPanel.js b/www/manager6/sdn/PrefixListPanel.js
index 451ff9646e0e..5b5c69c9a5f3 100644
--- a/www/manager6/sdn/PrefixListPanel.js
+++ b/www/manager6/sdn/PrefixListPanel.js
@@ -77,7 +77,7 @@ Ext.define('PVE.sdn.EditPrefixListEntryWindow', {
xtype: 'proxmoxtextfield',
fieldLabel: gettext('Prefix'),
name: 'prefix',
- vtype: 'IP64CIDRAddress',
+ vtype: 'IP64FullRangeCIDRAddress',
allowBlank: false,
},
{
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range
2026-05-12 11:21 [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Gabriel Goller
` (3 preceding siblings ...)
2026-05-12 11:21 ` [PATCH pve-manager 4/4] sdn: prefix-lists: change prefix format to allow bigger subnets Gabriel Goller
@ 2026-05-12 22:09 ` Thomas Lamprecht
2026-05-13 8:35 ` Gabriel Goller
4 siblings, 1 reply; 7+ messages in thread
From: Thomas Lamprecht @ 2026-05-12 22:09 UTC (permalink / raw)
To: Gabriel Goller, pve-devel
On 12/05/2026 13:20, Gabriel Goller wrote:
> This is a follow-up on the route-maps and prefix-list series by Stefan.
> The goal is to extend the CIDR range on the prefix-list, making it possible to
> allow prefixes such as 0.0.0.0/0, which is a classic "allow-all".
>
> The current IP64CIDRAddress(ui)/CIDR(api) format only allows a minimum of /8 CIDR. In order
> to keep it backwards compatible and avoid accidentally breaking migration or
> replication, create a new format.
ack, but putting it into common and widget toolkit has a strong YAGNI
smell and makes it harder to roll out without any real benefit.
For anything not really generic or when one already knows that it will
be more widely used I'd prefer putting it as close as possible to the
leaf nodes that actually use it in the package dependency tree, moving
them up to a more central dependency is always possible, and can be
much better judged then with an actual use case in mind (e.g., to a
minimal libpve-network-types-perl package, so that it can still live
in pve-network but used basically everywhere).
Here I'd rather start out with adding the format directly in
pve-network for the backend JSON schema one and pve-manager's
www/manager6/Toolkit.js for the UI ones.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range
2026-05-12 22:09 ` [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Thomas Lamprecht
@ 2026-05-13 8:35 ` Gabriel Goller
0 siblings, 0 replies; 7+ messages in thread
From: Gabriel Goller @ 2026-05-13 8:35 UTC (permalink / raw)
To: Thomas Lamprecht; +Cc: pve-devel
On 13.05.2026 00:09, Thomas Lamprecht wrote:
> On 12/05/2026 13:20, Gabriel Goller wrote:
> > This is a follow-up on the route-maps and prefix-list series by Stefan.
> > The goal is to extend the CIDR range on the prefix-list, making it possible to
> > allow prefixes such as 0.0.0.0/0, which is a classic "allow-all".
> >
> > The current IP64CIDRAddress(ui)/CIDR(api) format only allows a minimum of /8 CIDR. In order
> > to keep it backwards compatible and avoid accidentally breaking migration or
> > replication, create a new format.
>
> ack, but putting it into common and widget toolkit has a strong YAGNI
> smell and makes it harder to roll out without any real benefit.
>
> For anything not really generic or when one already knows that it will
> be more widely used I'd prefer putting it as close as possible to the
> leaf nodes that actually use it in the package dependency tree, moving
> them up to a more central dependency is always possible, and can be
> much better judged then with an actual use case in mind (e.g., to a
> minimal libpve-network-types-perl package, so that it can still live
> in pve-network but used basically everywhere).
>
> Here I'd rather start out with adding the format directly in
> pve-network for the backend JSON schema one and pve-manager's
> www/manager6/Toolkit.js for the UI ones.
Ack, thanks for the review.
Sent a new version:
https://lore.proxmox.com/pve-devel/20260513083430.63529-1-g.goller@proxmox.com/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-05-13 8:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 11:21 [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-common 1/4] jsonschema: add full-range CIDR JSON schema formats Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-network 2/4] sdn: prefix-list: allow full prefix CIDR range Gabriel Goller
2026-05-12 11:21 ` [PATCH proxmox-widget-toolkit 3/4] toolkit: Add IP/CIDR validator with full prefix range checks Gabriel Goller
2026-05-12 11:21 ` [PATCH pve-manager 4/4] sdn: prefix-lists: change prefix format to allow bigger subnets Gabriel Goller
2026-05-12 22:09 ` [PATCH common/manager/network/proxmox-widget-toolkit 0/4] Extend prefix-list CIDR range Thomas Lamprecht
2026-05-13 8:35 ` Gabriel Goller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox