From: Dietmar Maurer Date: Tue, 18 Mar 2014 06:05:06 +0000 (+0100) Subject: new method load_security_groups() X-Git-Url: https://git.proxmox.com/?p=pve-firewall.git;a=commitdiff_plain;h=e5d76bdebeda050970593357bfb172a606632e64 new method load_security_groups() --- diff --git a/src/PVE/Firewall.pm b/src/PVE/Firewall.pm index f6c4054..8594c9e 100644 --- a/src/PVE/Firewall.pm +++ b/src/PVE/Firewall.pm @@ -1670,11 +1670,7 @@ sub read_proc_net_route { return $res; } -sub compile { - my $vmdata = read_local_vm_config(); - my $vmfw_configs = read_vm_firewall_configs($vmdata); - - my $routing_table = read_proc_net_route(); +sub load_security_groups { my $groups_conf = {}; my $filename = "/etc/pve/firewall/groups.fw"; @@ -1682,6 +1678,17 @@ sub compile { $groups_conf = parse_group_fw_rules($filename, $fh); } + return $groups_conf; +} + +sub compile { + my $vmdata = read_local_vm_config(); + my $vmfw_configs = read_vm_firewall_configs($vmdata); + + my $routing_table = read_proc_net_route(); + + my $groups_conf = load_security_groups(); + my $ruleset = {}; ruleset_create_chain($ruleset, "PVEFW-INPUT");