Correct logic that decides if a reload is necessary during enable

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2020-02-26 14:39:05 -08:00
parent 1ec81b7d7b
commit dcde2bfa4a
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -1180,14 +1180,14 @@ CEOF
emit "fi\n"; emit "fi\n";
if ( get_interface_option( $interface, 'used_address_variable' ) ) { if ( get_interface_option( $interface, 'used_address_variable' ) ) {
my $variable = interface_address( $interface ); my $variable = get_interface_address( $interface );
emit( "echo \$$variable > \${VARDIR}/${physical}.address" ); emit( "echo $variable > \${VARDIR}/${physical}.address" );
} }
if ( get_interface_option( $interface, 'used_gateway_variable' ) ) { if ( get_interface_option( $interface, 'used_gateway_variable' ) ) {
my $variable = interface_gateway( $interface ); my $variable = get_interface_gateway( $interface );
emit( qq(echo "\$$variable" > \${VARDIR}/${physical}.gateway\n) ); emit( qq(echo "$variable" > \${VARDIR}/${physical}.gateway\n) );
} }
} else { } else {
emit( qq(progress_message "Provider $table ($number) Started") ); emit( qq(progress_message "Provider $table ($number) Started") );
@ -2323,22 +2323,22 @@ sub handle_optional_interfaces() {
emit( 'fi' ); emit( 'fi' );
if ( get_interface_option( $interface, 'used_address_variable' ) ) { if ( get_interface_option( $interface, 'used_address_variable' ) ) {
my $variable = interface_address( $interface ); my $variable = get_interface_address( $interface );
emit( '', emit( '',
"if [ -f \${VARDIR}/${physical}.address ]; then", "if [ -f \${VARDIR}/${physical}.address ]; then",
" if [ \$(cat \${VARDIR}/${physical}.address) != \$$variable ]; then", " if [ \$(cat \${VARDIR}/${physical}.address) != $variable ]; then",
' g_forcereload=Yes', ' g_forcereload=Yes',
' fi', ' fi',
'fi' ); 'fi' );
} }
if ( get_interface_option( $interface, 'used_gateway_variable' ) ) { if ( get_interface_option( $interface, 'used_gateway_variable' ) ) {
my $variable = interface_gateway( $interface ); my $variable = get_interface_gateway( $interface );
emit( '', emit( '',
"if [ -f \${VARDIR}/${physical}.gateway ]; then", "if [ -f \${VARDIR}/${physical}.gateway ]; then",
" if [ \$(cat \${VARDIR}/${physical}.gateway) != \"\$$variable\" ]; then", " if [ \$(cat \${VARDIR}/${physical}.gateway) != \"$variable\" ]; then",
' g_forcereload=Yes', ' g_forcereload=Yes',
' fi', ' fi',
'fi' ); 'fi' );