[pve-devel] [PATCH manager] ui: firewall: rule: maxlength for source and dest
Aaron Lauterer
a.lauterer at proxmox.com
Thu Apr 22 14:30:10 CEST 2021
Limiting the length of the source and dest paramters helps to avoid
problems with iptables-restore which would not apply a rule if a
parameter is larger than the parameter buffer (1024)[0]. As the API is
already limiting this, we should also reflect that in the GUI and give
people a hint that IP sets are most likely the better approach.
[0] http://git.netfilter.org/iptables/tree/iptables/xshared.c?h=v1.8.7#n469
Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
This one "needs" the firewall patch 'fix #967: source: dest: limit length'
As always when it comes to messages, someone might have a better idea
how to phrase the maxLengthText.
www/manager6/grid/FirewallRules.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
index 424bdfcb..f32a1ea1 100644
--- a/www/manager6/grid/FirewallRules.js
+++ b/www/manager6/grid/FirewallRules.js
@@ -135,7 +135,8 @@ Ext.define('PVE.FirewallRulePanel', {
base_url: me.list_refs_url,
value: '',
fieldLabel: gettext('Source'),
-
+ maxLength: 512,
+ maxLengthText: gettext('Too long, consider using IP sets.'),
},
{
xtype: 'pveIPRefSelector',
@@ -145,6 +146,8 @@ Ext.define('PVE.FirewallRulePanel', {
base_url: me.list_refs_url,
value: '',
fieldLabel: gettext('Destination'),
+ maxLength: 512,
+ maxLengthText: gettext('Too long, consider using IP sets.'),
},
);
--
2.20.1
More information about the pve-devel
mailing list