[pve-devel] [PATCH firewall] sort ipsets so that the digest is consistent

Dominik Csapak d.csapak at proxmox.com
Wed Nov 15 11:41:34 CET 2017


otherwise, editing an ipset randomly works (or not) due to
a wrong digest

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/API2/Firewall/IPSet.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/API2/Firewall/IPSet.pm b/src/PVE/API2/Firewall/IPSet.pm
index ea6d1a2..068c1a4 100644
--- a/src/PVE/API2/Firewall/IPSet.pm
+++ b/src/PVE/API2/Firewall/IPSet.pm
@@ -497,7 +497,7 @@ my $get_ipset_list = sub {
     my ($fw_conf) = @_;
 
     my $res = [];
-    foreach my $name (keys %{$fw_conf->{ipset}}) {
+    foreach my $name (sort keys %{$fw_conf->{ipset}}) {
 	my $data = { 
 	    name => $name,
 	};
-- 
2.11.0





More information about the pve-devel mailing list