]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: firewall: rule: maxlength for source and dest
authorAaron Lauterer <a.lauterer@proxmox.com>
Thu, 22 Apr 2021 12:30:10 +0000 (14:30 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Apr 2021 19:33:37 +0000 (21:33 +0200)
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@proxmox.com>
www/manager6/grid/FirewallRules.js

index 424bdfcbe60b442270d106ef50b6bbe891526b36..f32a1ea13193a3d7d85c78fee1d47e9bce536381 100644 (file)
@@ -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.'),
            },
        );