Avoid dereference of null variable

This commit is contained in:
Tom Eastep 2009-11-11 10:10:45 -08:00
parent ba8ad6346a
commit 6987cd15c5

View File

@ -1734,7 +1734,7 @@ sub match_source_dev( $ ) {
my $interface = shift; my $interface = shift;
return '' if $interface eq '+'; return '' if $interface eq '+';
my $interfaceref = known_interface( $interface ); my $interfaceref = known_interface( $interface );
my $physical = $interfaceref->{physical}; my $physical = $interfaceref ? $interfaceref->{physical} : $interface;
if ( $interfaceref && $interfaceref->{options}{port} ) { if ( $interfaceref && $interfaceref->{options}{port} ) {
"-i $interfaceref->{bridge} -m physdev --physdev-in $physical "; "-i $interfaceref->{bridge} -m physdev --physdev-in $physical ";
} else { } else {
@ -1749,7 +1749,7 @@ sub match_dest_dev( $ ) {
my $interface = shift; my $interface = shift;
return '' if $interface eq '+'; return '' if $interface eq '+';
my $interfaceref = known_interface( $interface ); my $interfaceref = known_interface( $interface );
my $physical = $interfaceref->{physical}; my $physical = $interfaceref ? $interfaceref->{physical} : $interface;
if ( $interfaceref && $interfaceref->{options}{port} ) { if ( $interfaceref && $interfaceref->{options}{port} ) {
if ( $capabilities{PHYSDEV_BRIDGE} ) { if ( $capabilities{PHYSDEV_BRIDGE} ) {
"-o $interfaceref->{bridge} -m physdev --physdev-is-bridged --physdev-out $physical "; "-o $interfaceref->{bridge} -m physdev --physdev-is-bridged --physdev-out $physical ";