From 255698f65192e736708f123d380bbed2aa8c3eac Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 7 May 2019 09:52:58 +0000 Subject: [PATCH] followup: do not replace original variable content this could be confusing, if someone adds code which uses $net->{ip} it may work for the case were ipfilter is off but not else (which may not get tested), so keep the original $net intact and copy the scalar value.. Signed-off-by: Thomas Lamprecht --- src/PVE/Firewall.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm index e46a3b1..f84e6d9 100644 --- a/src/PVE/Firewall.pm +++ b/src/PVE/Firewall.pm @@ -3782,11 +3782,11 @@ sub compile_ebtables_filter { push(@$arpfilter, $ip); } } - if ($net->{ip} && $vmfw_conf->{options}->{ipfilter}) { + if (my $ip = $net->{ip} && $vmfw_conf->{options}->{ipfilter}) { # ebtables changes this to a .0/MASK network but we just # want the address here, no network - see #2193 - $net->{ip} =~ s|/(\d+)$||; - push @$arpfilter, $net->{ip}; + $ip =~ s|/(\d+)$||; + push @$arpfilter, $ip; } generate_tap_layer2filter($ruleset, $iface, $macaddr, $vmfw_conf, $vmid, $arpfilter); } -- 2.39.2