From d2c3b034b65b73fb7e9e8255e1115868a3f80da4 Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 7 May 2007 21:44:55 +0000 Subject: [PATCH] Always supply options hash in a host entry git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6271 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Hosts.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Shorewall-perl/Shorewall/Hosts.pm b/Shorewall-perl/Shorewall/Hosts.pm index 99d50b6df..455c57e5d 100644 --- a/Shorewall-perl/Shorewall/Hosts.pm +++ b/Shorewall-perl/Shorewall/Hosts.pm @@ -83,7 +83,7 @@ sub validate_hosts_file() fatal_error "Invalid HOST(S) column contents: $hosts"; } - my $optionsref; + my $optionsref = {}; if ( $options ne '-' ) { my @options = split ',', $options; @@ -139,8 +139,7 @@ sub find_hosts_by_option( $ ) { while ( my ($type, $interfaceref) = each %{$zones{$zone}{hosts}} ) { while ( my ( $interface, $arrayref) = ( each %{$interfaceref} ) ) { for my $host ( @{$arrayref} ) { - my $optionsref = $host->{options}; - if ( $optionsref && $optionsref->{$option} ) { + if ( $host->{options}{$option} ) { for my $net ( @{$host->{hosts}} ) { push @hosts, [ $interface, $type eq 'ipsec4' ? 'ipsec' : 'none' , $net ]; }