From 1205831a68363b80123c31486f7f3516e81a2ce6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 28 Mar 2018 10:53:30 +0200 Subject: [PATCH] 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 --- src/PVE/Firewall.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.39.2