[pve-devel] [PATCH] Clarify zone names

mloiseleur michel at loiseleur.com
Mon Aug 20 20:53:51 CEST 2012


From: Michel Loiseleur <michel at loiseleur.com>

It transforms zones files like this:
#ZONE                          TYPE       OPTIONS
$FW                            firewall
$ZVMBR0                        ipv4
$ZVMBR0EXT:$ZVMBR0             bport
$ZVMBR0VM100:$ZVMBR0          bport
$ZVMBR0VM101:$ZVMBR0          bport

into this:
#ZONE                          TYPE       OPTIONS
$FW                            firewall
$VMBR0                         ipv4
$VMBR0_EXT:$VMBR0              bport
$VMBR0_VM100:$VMBR0            bport
$VMBR0_VM101:$VMBR0            bport

Signed-off-by: Michel Loiseleur <michel at loiseleur.com>
---
 PVE/Firewall.pm |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/Firewall.pm b/PVE/Firewall.pm
index 8767008..6a3f225 100644
--- a/PVE/Firewall.pm
+++ b/PVE/Firewall.pm
@@ -214,11 +214,11 @@ my $compile_shorewall = sub {
     $register_bridge = sub {
 	my ($bridge, $vlan) = @_;
 
-	my $zone =  'z' . $bridge;
+	my $zone =  $bridge;
 
 	return $zone if $zoneinfo->{$zone};
 
-	my $ext_zone = "z${bridge}ext";
+	my $ext_zone = "${bridge}_ext";
 
 	$zoneinfo->{$zone} = {
 	    type => 'bridge',
@@ -249,7 +249,7 @@ my $compile_shorewall = sub {
 	my ($bridge, $vlan, $vmzone, $tap) = @_;
 
 	my $bridge_zone = &$register_bridge($bridge, $vlan);
-	my $zone = $bridge_zone . $vmzone;
+	my $zone = $bridge_zone . '_' . $vmzone;
 
 	if (!$zoneinfo->{$zone}) {
 	    $zoneinfo->{$zone} = {
-- 
1.7.2.5



More information about the pve-devel mailing list