mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-16 11:20:53 +01:00
Fix edge case involving 'optional' and 'detectnets'
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6483 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
88bfa62395
commit
469de8bbb4
@ -42,6 +42,7 @@ our @EXPORT = qw( add_group_to_zone
|
||||
interface_is_optional
|
||||
find_interfaces_by_option
|
||||
get_interface_option
|
||||
clear_interface_option
|
||||
|
||||
@interfaces );
|
||||
our @EXPORT_OK = ();
|
||||
@ -435,4 +436,13 @@ 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;
|
||||
|
@ -714,7 +714,14 @@ sub setup_mac_lists( $ ) {
|
||||
|
||||
fatal_error "Invalid DISPOSITION ( $disposition)" if ( $table eq 'mangle' ) && ! $targetref->{mangle};
|
||||
|
||||
fatal_error "No hosts on $interface have the maclist option specified" unless $maclist_interfaces{$interface};
|
||||
unless ( $maclist_interfaces{$interface} ) {
|
||||
if ( get_interface_option( $interface, 'optional' ) && get_interface_option( $interface, 'detectnets' ) ) {
|
||||
clear_interface_option( $interface, 'maclist' );
|
||||
next;
|
||||
}
|
||||
|
||||
fatal_error "No hosts on $interface have the maclist option specified";
|
||||
}
|
||||
|
||||
my $chainref = $chain_table{$table}{( $ttl ? macrecent_target $interface : mac_chain $interface )};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user