From f5d9097817ec0adf083729d8f9585c23090f0552 Mon Sep 17 00:00:00 2001 From: teastep Date: Sun, 6 May 2007 18:27:41 +0000 Subject: [PATCH] Fix find_hosts_by_option() -- Take 2 git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6258 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Hosts.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Hosts.pm b/Shorewall-perl/Shorewall/Hosts.pm index 8fa6ed336..8105f85c3 100644 --- a/Shorewall-perl/Shorewall/Hosts.pm +++ b/Shorewall-perl/Shorewall/Hosts.pm @@ -139,7 +139,8 @@ sub find_hosts_by_option( $ ) { while ( my ($type, $interfaceref) = each %{$zones{$zone}{hosts}} ) { while ( my ( $interface, $arrayref) = ( each %{$interfaceref} ) ) { for my $host ( @{$arrayref} ) { - if ( $host->{options}{$option} ) { + my $optionsref = $host->{options}; + if ( $optionsref && $optionsref->{$option} ) { for my $net ( @{$host->{hosts}} ) { push @hosts, [ $interface, $type eq 'ipsec4' ? 'ipsec' : 'none' , $net ]; }