From 60b8e92dc1e3257db28e2d9a6d395e753b906c87 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 9 Jun 2011 17:09:53 -0700 Subject: [PATCH] Don't leave unused sfilter chains in the config Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Misc.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Misc.pm b/Shorewall/Perl/Shorewall/Misc.pm index 0472f07f8..2f1fe3620 100644 --- a/Shorewall/Perl/Shorewall/Misc.pm +++ b/Shorewall/Perl/Shorewall/Misc.pm @@ -568,9 +568,13 @@ sub add_common_rules() { } # - # Delete 'sfilter' chain unless there are referenced to it + # Delete 'sfilter' chains unless there are referenced to them # - $chainref->{referenced} = 0 unless keys %{($chainref = $filter_table->{sfilter})->{references}}; + for ( qw/sfilter sfilter1/ ) { + if ( $chainref = $filter_table->{$_} ) { + $chainref->{referenced} = 0 unless keys %{$chainref->{references}}; + } + } run_user_exit1 'initdone';