Merge branch '5.1.11' into 5.1.12

This commit is contained in:
Tom Eastep 2018-01-28 13:15:42 -08:00
commit 37101a2031
3 changed files with 12 additions and 19 deletions

View File

@ -313,9 +313,9 @@ sub generate_script_2() {
if ( $global_variables == ( ALL_COMMANDS | NOT_RESTORE ) ) {
verify_required_interfaces(0);
set_global_variables(0, 0);
handle_optional_interfaces(0);
handle_optional_interfaces;
}
emit ';;';
@ -327,19 +327,21 @@ sub generate_script_2() {
push_indent;
}
verify_required_interfaces(1);
set_global_variables(1,1);
if ( $global_variables & NOT_RESTORE ) {
handle_optional_interfaces(1);
handle_optional_interfaces;
emit ';;';
pop_indent;
pop_indent;
emit ( 'esac' );
} else {
handle_optional_interfaces(1);
handle_optional_interfaces;
}
} else {
emit( 'true' ) unless handle_optional_interfaces(1);
verify_required_interfaces(1);
emit( 'true' ) unless handle_optional_interfaces;
}
pop_indent;

View File

@ -2195,17 +2195,13 @@ sub provider_realm( $ ) {
}
#
# This function is called by the compiler when it is generating the detect_configuration() function.
# The function calls Shorewall::Zones::verify_required_interfaces then emits code to set the
# ..._IS_USABLE interface variables appropriately for the optional interfaces
# Perform processing related to optional interfaces. Returns true if there are optional interfaces.
#
# Returns true if there were required or optional interfaces
#
sub handle_optional_interfaces( $ ) {
sub handle_optional_interfaces() {
my @interfaces;
my $wildcards;
#
# First do the provider interfacess. Those that are real providers will never have wildcard physical
# names but they might derive from wildcard interface entries. Optional interfaces which do not have
@ -2229,10 +2225,6 @@ sub handle_optional_interfaces( $ ) {
if ( @interfaces ) {
my $require = $config{REQUIRE_INTERFACE};
my $gencase = shift;
verify_required_interfaces( $gencase );
emit '' if $gencase;
emit( 'HAVE_INTERFACE=', '' ) if $require;
#
@ -2396,8 +2388,6 @@ sub handle_optional_interfaces( $ ) {
return 1;
}
verify_required_interfaces( shift );
}
#

View File

@ -2021,6 +2021,7 @@ sub verify_required_interfaces( $ ) {
emit( "esac\n" );
$returnvalue = 1;
}
$interfaces = find_interfaces_by_option( 'required' );
@ -2066,7 +2067,7 @@ sub verify_required_interfaces( $ ) {
emit( ';;' );
pop_indent;
pop_indent;
emit( 'esac' );
emit( "esac\n" );
}
$returnvalue = 1;