From 4cc7a1b87d2d3f5bba585ec5028f25d81e2203a3 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 13 Aug 2015 13:21:51 -0700 Subject: [PATCH] Correct tcrules update Signed-off-by: Tom Eastep Conflicts: Shorewall/Perl/Shorewall/Tc.pm --- Shorewall/Perl/Shorewall/Tc.pm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm index be91e9d6c..3867a7086 100644 --- a/Shorewall/Perl/Shorewall/Tc.pm +++ b/Shorewall/Perl/Shorewall/Tc.pm @@ -3226,12 +3226,17 @@ sub setup_tc( $ ) { } } + close $mangle, directive_callback( 0 ) if $tcrules; + + } elsif ( $tcrules ) { close $mangle, directive_callback( 0 ); - } elsif ( -f ( my $fn = find_file( 'tcrules' ) ) ) { - if ( unlink $fn ) { - warning_message "Empty tcrules file ($fn) removed"; - } else { - warning_message "Unable to remove empty tcrules file $fn: $!"; + + if ( -f ( my $fn = find_file( 'tcrules' ) ) ) { + if ( unlink $fn ) { + warning_message "Empty tcrules file ($fn) removed"; + } else { + warning_message "Unable to remove empty tcrules file $fn: $!"; + } } } } elsif ( -f ( my $fn = find_file( 'tcrules' ) ) ) {