diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index a0ce20821..5330e45a9 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -308,13 +308,14 @@ sub generate_script_2() { set_global_variables(1); - handle_optional_interfaces(0); - if ( $global_variables & NOT_RESTORE ) { + handle_optional_interfaces(0); emit ';;'; pop_indent; pop_indent; emit ( 'esac' ); + } else { + handle_optional_interfaces(1); } } else { emit( 'true' ) unless handle_optional_interfaces(1); diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index 580484966..cd7cafdf4 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -1894,8 +1894,10 @@ sub handle_optional_interfaces( $ ) { if ( @$interfaces ) { my $require = $config{REQUIRE_INTERFACE}; + my $gencase = shift; - verify_required_interfaces( shift ); + verify_required_interfaces( $gencase ); + emit '' if $gencase; emit( 'HAVE_INTERFACE=', '' ) if $require; #