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 ]; }