From a167e3449edd5ed01a167544245872891cbf5d92 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 9 Mar 2013 07:56:16 -0800 Subject: [PATCH] Avoid Perl run-time errors when checking a provider interface. - Handle case where a provider interface matches a wildcard Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Zones.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Zones.pm b/Shorewall/Perl/Shorewall/Zones.pm index 37ba14e67..495d75bcc 100644 --- a/Shorewall/Perl/Shorewall/Zones.pm +++ b/Shorewall/Perl/Shorewall/Zones.pm @@ -1402,6 +1402,7 @@ sub known_interface($) number => $interfaceref->{number} , physical => $physical , base => var_base( $physical ) , + zones => $interfaceref->{zones} , }; } } @@ -1496,9 +1497,10 @@ sub source_port_to_bridge( $ ) { # Returns a hash reference for the zones interface through the interface # sub interface_zones( $ ) { - my $interfaceref = $interfaces{(shift)}; + my $interfaceref = known_interface( $_[0] ); - $interfaceref->{zones}; + fatal_error "Unknown interface(@_)" unless $interfaceref; + $interfaceref->{zones} || {}; } #