Simplify last fix

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6484 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-06-07 23:34:11 +00:00
parent 469de8bbb4
commit 409ef2ece4
2 changed files with 2 additions and 15 deletions

View File

@ -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;

View File

@ -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";
}