From: Wolfgang Bumiller Date: Wed, 28 Mar 2018 08:53:30 +0000 (+0200) Subject: avoid double spaces in ruleset_addrule X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=commitdiff_plain;h=1205831a68363b80123c31486f7f3516e81a2ce6 avoid double spaces in ruleset_addrule ebtables doesn't have comment rules we could store the digest in, so we need to match the ebtables-save output instead. Signed-off-by: Wolfgang Bumiller Reviewed-by: Thomas Lamprecht Tested-by: Thomas Lamprecht --- diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm index 5452167..b8ade7c 100644 --- a/src/PVE/Firewall.pm +++ b/src/PVE/Firewall.pm @@ -2065,7 +2065,9 @@ sub ruleset_addrule { my $logaction = get_log_rule_base($chain, $vmid, $logmsg, $log); push @{$ruleset->{$chain}}, "-A $chain $match $logaction"; } - push @{$ruleset->{$chain}}, "-A $chain $match $action"; + # for stable ebtables digests avoid double-spaces to match ebtables-save output + $match .= ' ' if length($match); + push @{$ruleset->{$chain}}, "-A $chain ${match}$action"; } sub ruleset_insertrule {