Allow 'refresh' to reload chains from the BLACKLIST section.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-10-30 06:05:24 -07:00
parent e997b7e662
commit 29f6f6e3f2

View File

@ -1162,6 +1162,8 @@ sub add_reference ( $$ ) {
assert($toref); assert($toref);
$toref->{blacklistsection} ||= $fromref->{blacklistsection};
$toref->{references}{$fromref->{name}}++; $toref->{references}{$fromref->{name}}++;
} }
@ -6020,6 +6022,13 @@ sub create_chainlist_reload($) {
unless ( @chains ) { unless ( @chains ) {
@chains = qw( blacklst ) if $filter_table->{blacklst}; @chains = qw( blacklst ) if $filter_table->{blacklst};
push @chains, 'blackout' if $filter_table->{blackout}; push @chains, 'blackout' if $filter_table->{blackout};
unless ( @chains ) {
for ( grep $_->{blacklistsection} && $_->{referenced}, values %{$filter_table} ) {
push @chains, $_->{name} if $_->{blacklistsection};
}
}
push @chains, 'mangle:' if have_capability( 'MANGLE_ENABLED' ) && $config{MANGLE_ENABLED}; push @chains, 'mangle:' if have_capability( 'MANGLE_ENABLED' ) && $config{MANGLE_ENABLED};
$chains = join( ',', @chains ) if @chains; $chains = join( ',', @chains ) if @chains;
} }