forked from extern/shorewall_code
Rework handle_optional_interfaces() somewhat
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
8077c9e1c3
commit
7f0f4516d7
@ -845,14 +845,14 @@ sub lookup_provider( $ ) {
|
||||
#
|
||||
sub handle_optional_interfaces( $ ) {
|
||||
|
||||
my $returnvalue = verify_required_interfaces( shift );
|
||||
my $require = $config{REQUIRE_INTERFACE};
|
||||
my $wildcards = 0;
|
||||
my $interfaces = find_interfaces_by_option1 'optional', $wildcards;
|
||||
|
||||
emit( 'HAVE_INTERFACE=', '' ) if $require;
|
||||
my ( $interfaces, $wildcards ) = find_interfaces_by_option1 'optional';
|
||||
|
||||
if ( @$interfaces ) {
|
||||
my $require = $config{REQUIRE_INTERFACE};
|
||||
|
||||
verify_required_interfaces( shift );
|
||||
|
||||
emit( 'HAVE_INTERFACE=', '' ) if $require;
|
||||
#
|
||||
# Clear the '_IS_USABLE' variables
|
||||
#
|
||||
@ -960,10 +960,10 @@ sub handle_optional_interfaces( $ ) {
|
||||
);
|
||||
}
|
||||
|
||||
$returnvalue = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
$returnvalue;
|
||||
verify_required_interfaces( shift );
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -1292,10 +1292,10 @@ sub find_interfaces_by_option( $ ) {
|
||||
# Returns reference to array of interfaces with the passed option. Unlike the preceding function, this one:
|
||||
#
|
||||
# - All entries in %interfaces are searched.
|
||||
# - The second argument is used to return an indication of the presents of wildcard interfaces
|
||||
# - Returns a two-element list; the second element indicates whether any members of the list have wildcard physical names
|
||||
#
|
||||
sub find_interfaces_by_option1( $\$ ) {
|
||||
my ( $option, $wildref) = @_;
|
||||
sub find_interfaces_by_option1( $ ) {
|
||||
my $option = $_[0];
|
||||
my @ints = ();
|
||||
my $wild = 0;
|
||||
|
||||
@ -1313,8 +1313,9 @@ sub find_interfaces_by_option1( $\$ ) {
|
||||
}
|
||||
}
|
||||
|
||||
$$wildref = $wild;
|
||||
\@ints;
|
||||
return unless defined wantarray;
|
||||
|
||||
wantarray ? ( \@ints, $wild ) : \@ints;
|
||||
}
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user