Use MUTEX_TIMEOUT for ip[6]tables --wait interval

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-08-15 13:18:19 -07:00
parent 7e3521e221
commit 8641d53bd1
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
2 changed files with 9 additions and 3 deletions

View File

@ -8916,7 +8916,7 @@ sub create_netfilter_load( $ ) {
'if [ "$COMMAND" = reload -a -n "$g_counters" ] && chain_exists $g_sha1sum1 && chain_exists $g_sha1sum2 ; then' );
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
emit( ' option="--counters --wait"' );
emit( ' option="--counters --wait "' . $config{MUTEX_TIMEOUT} );
} else {
emit( ' option="--counters"' );
}
@ -8930,7 +8930,7 @@ sub create_netfilter_load( $ ) {
push_indent;
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
emit 'option="--wait"';
emit 'option="--wait "' . $config{MUTEX_TIMEOUT};
} else {
emit 'option=';
}
@ -9349,7 +9349,7 @@ sub create_stop_load( $ ) {
enter_cmd_mode;
if ( have_capability( 'RESTORE_WAIT_OPTION' ) ) {
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY . ' --wait' );
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command="$' . $UTILITY . ' --wait ' . $config{MUTEX_TIMEOUT} . '"' );
} else {
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY );
}

View File

@ -6842,6 +6842,12 @@ sub get_configuration( $$$$ ) {
}
}
if ( supplied( $val = $config{MUTEX_TIMEOUT} ) ) {
fatal_error "Invalid value ($val) for MUTEX_TIMEOUT" unless $val && $val =~ /^\d+$/;
} else {
$config{MUTEX_TIMEOUT} = 60;
}
add_variables %config;
while ( my ($var, $val ) = each %renamed ) {