]> git.proxmox.com Git - pve-firewall.git/blobdiff - PVE/Firewall.pm
implement stop command using new iptables_get_chains
[pve-firewall.git] / PVE / Firewall.pm
index 16ded99986028c1c07fc9a11018749c104f413a2..8a83dcb862b126fc64893c84bcf3964333adfecb 100644 (file)
@@ -146,12 +146,8 @@ sub iptables {
     run_command("/sbin/iptables $cmd", outfunc => sub {}, errfunc => sub {});
 }
 
-sub iptables_restore {
-
-    unshift (@ruleset, '*filter');
-    push (@ruleset, 'COMMIT');
-
-    my $cmdlist = join("\n", @ruleset) . "\n";
+sub iptables_restore_cmdlist {
+    my ($cmdlist) = @_;
 
     my $verbose = 1; # fixme: how/when do we set this
 
@@ -163,6 +159,16 @@ sub iptables_restore {
     }
 }
 
+sub iptables_restore {
+
+    unshift (@ruleset, '*filter');
+    push (@ruleset, 'COMMIT');
+
+    my $cmdlist = join("\n", @ruleset) . "\n";
+
+    iptables_restore_cmdlist($cmdlist);
+}
+
 # experimental code to read existing chains and compute SHA1 checksum
 # for each chain. 
 sub iptables_get_chains {
@@ -176,6 +182,7 @@ sub iptables_get_chains {
        return 1 if $name =~ m/^BRIDGEFW-(:?IN|OUT)$/;
        return 1 if $name =~ m/^proxmoxfw-\S+$/;
        return 1 if $name =~ m/^tap\d+i\d+-(:?IN|OUT)$/;
+       return 1 if $name =~ m/^vmbr\d+-(:?IN|OUT)$/;
 
        return undef;
     };