From 626b28fcd09f38e1bb7c6fe1d6297ce226055ed7 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 23 Mar 2010 09:28:11 -0700 Subject: [PATCH] Auto-detect bridge when no options specified. Remove extra logic. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Zones.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Zones.pm b/Shorewall/Perl/Shorewall/Zones.pm index 549f99aed..a42121faf 100644 --- a/Shorewall/Perl/Shorewall/Zones.pm +++ b/Shorewall/Perl/Shorewall/Zones.pm @@ -753,9 +753,6 @@ sub process_interface( $$ ) { fatal_error "Firewall zone not allowed in ZONE column of interface record" if $zoneref->{type} == FIREWALL; } - $bcasts = '' if $bcasts eq '-'; - $options = '' if $options eq '-'; - my ($interface, $port, $extra) = split /:/ , $originalinterface, 3; fatal_error "Invalid INTERFACE ($originalinterface)" if ! $interface || defined $extra; @@ -800,7 +797,7 @@ sub process_interface( $$ ) { my $physical = $interface; my $broadcasts; - unless ( $bcasts eq '' || $bcasts eq 'detect' ) { + unless ( $bcasts eq '-' || $bcasts eq 'detect' ) { my @broadcasts = split_list $bcasts, 'address'; for my $address ( @broadcasts ) { @@ -820,7 +817,7 @@ sub process_interface( $$ ) { my $hostoptionsref = {}; - if ( $options ) { + if ( $options ne '-' ) { my %hostoptions = ( dynamic => 0 ); @@ -941,7 +938,12 @@ sub process_interface( $$ ) { $zoneref->{options}{in_out}{routeback} = 1 if $zoneref && $options{routeback}; $hostoptionsref = \%hostoptions; - } + } else { + # + # No options specified -- auto-detect bridge + # + $hostoptionsref->{routeback} = $options{routeback} = is_a_bridge( $physical ) unless $export; + } $physical{$physical} = $interfaces{$interface} = { name => $interface , bridge => $bridge ,