From 4a1072dd84b9fcad883d7df5ee1ac55f2542a3b2 Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Thu, 23 Aug 2018 16:04:50 +0200 Subject: [PATCH] Fix #1841: ebtables: sort interfaces per guest Signed-off-by: Stoiko Ivanov --- src/PVE/Firewall.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm index fefe42a..ef00d0c 100644 --- a/src/PVE/Firewall.pm +++ b/src/PVE/Firewall.pm @@ -3678,7 +3678,7 @@ sub compile_ebtables_filter { my $vmfw_conf = $vmfw_configs->{$vmid}; return if !$vmfw_conf; - foreach my $netid (keys %$conf) { + foreach my $netid (sort keys %$conf) { next if $netid !~ m/^net(\d+)$/; my $net = PVE::QemuServer::parse_net($conf->{$netid}); next if !$net->{firewall}; @@ -3700,7 +3700,7 @@ sub compile_ebtables_filter { my $vmfw_conf = $vmfw_configs->{$vmid}; return if !$vmfw_conf || !$vmfw_conf->{options}->{enable}; - foreach my $netid (keys %$conf) { + foreach my $netid (sort keys %$conf) { next if $netid !~ m/^net(\d+)$/; my $net = PVE::LXC::Config->parse_lxc_network($conf->{$netid}); next if !$net->{firewall}; -- 2.39.2