public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-manager] fix #4963: firewall: fix editing firewall rules using cidrs
@ 2024-01-15 16:28 Stefan Hanreich
  2024-01-16 10:33 ` Mira Limbeck
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hanreich @ 2024-01-15 16:28 UTC (permalink / raw)
  To: pve-devel

Fallback to v.ref when we do not use an alias or ipset in order to be
able to use normal CIDRs as source / destination address again

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 www/manager6/form/IPRefSelector.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/www/manager6/form/IPRefSelector.js b/www/manager6/form/IPRefSelector.js
index b50ac1e10..7e5eea63a 100644
--- a/www/manager6/form/IPRefSelector.js
+++ b/www/manager6/form/IPRefSelector.js
@@ -37,8 +37,10 @@ Ext.define('PVE.form.IPRefSelector', {
 		    calculate: function(v) {
 			if (v.type === 'alias') {
 			    return `${v.scope}/${v.name}`;
-			} else {
+			} else if (v.type === 'ipset') {
 			    return `+${v.scope}/${v.name}`;
+			} else {
+			    return v.ref;
 			}
 		    },
 		},
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH pve-manager] fix #4963: firewall: fix editing firewall rules using cidrs
  2024-01-15 16:28 [pve-devel] [PATCH pve-manager] fix #4963: firewall: fix editing firewall rules using cidrs Stefan Hanreich
@ 2024-01-16 10:33 ` Mira Limbeck
  2024-01-16 14:31   ` Stefan Hanreich
  0 siblings, 1 reply; 3+ messages in thread
From: Mira Limbeck @ 2024-01-16 10:33 UTC (permalink / raw)
  To: pve-devel

On 1/15/24 17:28, Stefan Hanreich wrote:
> Fallback to v.ref when we do not use an alias or ipset in order to be
> able to use normal CIDRs as source / destination address again
> 
> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
> ---
>  www/manager6/form/IPRefSelector.js | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/form/IPRefSelector.js b/www/manager6/form/IPRefSelector.js
> index b50ac1e10..7e5eea63a 100644
> --- a/www/manager6/form/IPRefSelector.js
> +++ b/www/manager6/form/IPRefSelector.js
> @@ -37,8 +37,10 @@ Ext.define('PVE.form.IPRefSelector', {
>  		    calculate: function(v) {
>  			if (v.type === 'alias') {
>  			    return `${v.scope}/${v.name}`;
> -			} else {
> +			} else if (v.type === 'ipset') {
>  			    return `+${v.scope}/${v.name}`;
> +			} else {
> +			    return v.ref;
>  			}
>  		    },
>  		},

This removes the error reported in the bug tracker, but new changes to
the IP are not recognized.
E.g.:
original IP range: 10.0.0.0/8
new IP range: 192.168.0.0/24

The `ok` button is still disabled unless you change anything else,
change to an IPset or alias, or remove the entire IP entry via the `x`
and type it again.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH pve-manager] fix #4963: firewall: fix editing firewall rules using cidrs
  2024-01-16 10:33 ` Mira Limbeck
@ 2024-01-16 14:31   ` Stefan Hanreich
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hanreich @ 2024-01-16 14:31 UTC (permalink / raw)
  To: Proxmox VE development discussion, Mira Limbeck



On 1/16/24 11:33, Mira Limbeck wrote:
> This removes the error reported in the bug tracker, but new changes to
> the IP are not recognized.
> E.g.:
> original IP range: 10.0.0.0/8
> new IP range: 192.168.0.0/24
> 
> The `ok` button is still disabled unless you change anything else,
> change to an IPset or alias, or remove the entire IP entry via the `x`
> and type it again.

Thanks for the report, didn't notice that.

Sent a v2 here:
https://lists.proxmox.com/pipermail/pve-devel/2024-January/061388.html




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-16 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-15 16:28 [pve-devel] [PATCH pve-manager] fix #4963: firewall: fix editing firewall rules using cidrs Stefan Hanreich
2024-01-16 10:33 ` Mira Limbeck
2024-01-16 14:31   ` Stefan Hanreich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal