From 409ef2ece4663398978d3014b6aef464e11420b9 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 7 Jun 2007 23:34:11 +0000 Subject: [PATCH] Simplify last fix git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6484 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Interfaces.pm | 11 +---------- Shorewall-perl/Shorewall/Rules.pm | 6 +----- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Shorewall-perl/Shorewall/Interfaces.pm b/Shorewall-perl/Shorewall/Interfaces.pm index f4be3d8e1..3a51dc699 100644 --- a/Shorewall-perl/Shorewall/Interfaces.pm +++ b/Shorewall-perl/Shorewall/Interfaces.pm @@ -42,7 +42,6 @@ our @EXPORT = qw( add_group_to_zone interface_is_optional find_interfaces_by_option get_interface_option - clear_interface_option @interfaces ); our @EXPORT_OK = (); @@ -325,6 +324,7 @@ sub validate_interfaces_file( $ ) fatal_error "The 'detectnets' option may not be used with the '-e' compiler option" if $export; @networks = get_routed_networks( $interface, 'detectnets not allowed on interface with default route' ); fatal_error "No routes found through 'detectnets' interface $interface" unless @networks || $options{optional}; + delete $options{maclist} unless @networks; } else { @networks = @allipv4; } @@ -436,13 +436,4 @@ sub get_interface_option( $$ ) { $interfaces{$interface}{options}{$option}; } -# -# Clear an option for an interface -# -sub clear_interface_option( $$ ) { - my ( $interface, $option ) = @_; - - delete $interfaces{$interface}{options}{$option}; -} - 1; diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index 4e35e314f..38072de45 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -715,11 +715,7 @@ sub setup_mac_lists( $ ) { fatal_error "Invalid DISPOSITION ( $disposition)" if ( $table eq 'mangle' ) && ! $targetref->{mangle}; unless ( $maclist_interfaces{$interface} ) { - if ( get_interface_option( $interface, 'optional' ) && get_interface_option( $interface, 'detectnets' ) ) { - clear_interface_option( $interface, 'maclist' ); - next; - } - + next if get_interface_option( $interface, 'optional' ) && get_interface_option( $interface, 'detectnets' ); fatal_error "No hosts on $interface have the maclist option specified"; }