Don't generate refresh rules unless the command is 'refresh'

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-05-16 13:08:32 -07:00
parent 68136ea53a
commit bf9309e441
4 changed files with 21 additions and 8 deletions

View File

@ -4682,13 +4682,21 @@ sub create_chainlist_reload($) {
my $chains = $_[0]; my $chains = $_[0];
my @chains = split_list $chains, 'chain'; my @chains;
unless ( @chains ) { unless ( $chains eq ':none:' ) {
@chains = qw( blacklst ) if $filter_table->{blacklst}; if ( $chains eq ':refresh:' ) {
push @chains, 'blackout' if $filter_table->{blackout}; $chains = '';
push @chains, 'mangle:' if have_capability( 'MANGLE_ENABLED' ) && $config{MANGLE_ENABLED}; } else {
$chains = join( ',', @chains ) if @chains; @chains = split_list $chains, 'chain';
}
unless ( @chains ) {
@chains = qw( blacklst ) if $filter_table->{blacklst};
push @chains, 'blackout' if $filter_table->{blackout};
push @chains, 'mangle:' if have_capability( 'MANGLE_ENABLED' ) && $config{MANGLE_ENABLED};
$chains = join( ',', @chains ) if @chains;
}
} }
$mode = NULL_MODE; $mode = NULL_MODE;

View File

@ -73,7 +73,7 @@ my $shorewall_dir = '';
my $verbose = 0; my $verbose = 0;
my $timestamp = 0; my $timestamp = 0;
my $debug = 0; my $debug = 0;
my $chains = ''; my $chains = ':none:';
my $log = ''; my $log = '';
my $log_verbose = 0; my $log_verbose = 0;
my $help = 0; my $help = 0;

View File

@ -826,6 +826,8 @@ refresh_command() {
g_refreshchains="$g_refreshchains,$1" g_refreshchains="$g_refreshchains,$1"
shift shift
done done
else
g_refreshchains=:refresh:
fi fi
shorewall_is_started || fatal_error "Shorewall is not running" shorewall_is_started || fatal_error "Shorewall is not running"
@ -1470,7 +1472,7 @@ g_verbose_offset=0
g_use_verbosity= g_use_verbosity=
g_debug= g_debug=
g_export= g_export=
g_refreshchains= g_refreshchains=:none:
# #
# Make sure that these variables are cleared # Make sure that these variables are cleared

View File

@ -757,6 +757,8 @@ refresh_command() {
g_refreshchains="$g_refreshchains,$1" g_refreshchains="$g_refreshchains,$1"
shift shift
done done
else
g_refreshchains=:refresh:
fi fi
shorewall6_is_started || fatal_error "Shorewall6 is not running" shorewall6_is_started || fatal_error "Shorewall6 is not running"
@ -1378,6 +1380,7 @@ g_verbose_offset=0
g_use_verbosity= g_use_verbosity=
g_debug= g_debug=
g_export= g_export=
g_refreshchains=:none:
g_noroutes= g_noroutes=
g_purge= g_purge=