mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-19 17:28:35 +02:00
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( $ ) {
|
sub handle_optional_interfaces( $ ) {
|
||||||
|
|
||||||
my $returnvalue = verify_required_interfaces( shift );
|
my ( $interfaces, $wildcards ) = find_interfaces_by_option1 'optional';
|
||||||
my $require = $config{REQUIRE_INTERFACE};
|
|
||||||
my $wildcards = 0;
|
|
||||||
my $interfaces = find_interfaces_by_option1 'optional', $wildcards;
|
|
||||||
|
|
||||||
emit( 'HAVE_INTERFACE=', '' ) if $require;
|
|
||||||
|
|
||||||
if ( @$interfaces ) {
|
if ( @$interfaces ) {
|
||||||
|
my $require = $config{REQUIRE_INTERFACE};
|
||||||
|
|
||||||
|
verify_required_interfaces( shift );
|
||||||
|
|
||||||
|
emit( 'HAVE_INTERFACE=', '' ) if $require;
|
||||||
#
|
#
|
||||||
# Clear the '_IS_USABLE' variables
|
# 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:
|
# Returns reference to array of interfaces with the passed option. Unlike the preceding function, this one:
|
||||||
#
|
#
|
||||||
# - All entries in %interfaces are searched.
|
# - 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( $\$ ) {
|
sub find_interfaces_by_option1( $ ) {
|
||||||
my ( $option, $wildref) = @_;
|
my $option = $_[0];
|
||||||
my @ints = ();
|
my @ints = ();
|
||||||
my $wild = 0;
|
my $wild = 0;
|
||||||
|
|
||||||
@ -1313,8 +1313,9 @@ sub find_interfaces_by_option1( $\$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$$wildref = $wild;
|
return unless defined wantarray;
|
||||||
\@ints;
|
|
||||||
|
wantarray ? ( \@ints, $wild ) : \@ints;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user