]> git.proxmox.com Git - pve-firewall.git/commitdiff
fix #4175: ignore non-filter ebtables tables
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 27 Jul 2022 13:07:52 +0000 (15:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 29 Aug 2022 07:38:55 +0000 (09:38 +0200)
we only ever add rules to the filter table, without this we'd add all
rules from other tables (which might have been manually filled by the
admin) to the filter table as well - adding another copy on every
iteration of the firewall update cycle!

note that ebtables-restore seems to flush tables contained in its input,
but leave those alone which are not referenced at all.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/PVE/Firewall.pm

index 3c6f0df11cdea1abb0abaafafd6102ab8167074d..56868d4326228f5dc6b8350bcb41e98f783db7dc 100644 (file)
@@ -1971,10 +1971,18 @@ sub ebtables_get_chains {
 
     my $res = {};
     my $chains = {};
+    my $table;
     my $parser = sub {
        my $line = shift;
        return if $line =~ m/^#/;
        return if $line =~ m/^\s*$/;
+       if ($line =~ m/^\*(\S+)$/) {
+           $table = $1;
+           return;
+       }
+
+       return if $table ne "filter";
+
        if ($line =~ m/^:(\S+)\s(ACCEPT|DROP|RETURN)$/) {
            # Make sure we know chains exist even if they're empty.
            $chains->{$1} //= [];