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 ffe7a1b777
commit 11ff245697
4 changed files with 21 additions and 8 deletions

View File

@ -4679,13 +4679,21 @@ sub create_chainlist_reload($) {
my $chains = $_[0];
my @chains = split_list $chains, 'chain';
my @chains;
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;
unless ( $chains eq ':none:' ) {
if ( $chains eq ':refresh:' ) {
$chains = '';
} else {
@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;

View File

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

View File

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

View File

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