From 7da375634a7ead984210010ed6d8ecb8b63d5d36 Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 31 Jul 2007 14:13:10 +0000 Subject: [PATCH] Fix ECN in shorewall-perl (again) git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7010 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Config.pm | 15 +++++++++++++++ Shorewall-perl/Shorewall/Rules.pm | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index bf85b0001..bc16731c9 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -57,6 +57,7 @@ our @EXPORT = qw( finalize_aux_config warning_message + error_message fatal_error set_shorewall_dir set_debug @@ -403,6 +404,20 @@ sub warning_message } } +# +# Issue a Error Message +# +sub warning_message +{ + my $currentlineinfo = $currentfile ? " : $currentfilename (line $currentlinenumber)" : ''; + + if ( $debug ) { + print STDERR longmess( " ERROR: @_$currentlineinfo" ); + } else { + print STDERR " ERROR: @_$currentlineinfo\n"; + } +} + # # Issue fatal error message and die # diff --git a/Shorewall-perl/Shorewall/Rules.pm b/Shorewall-perl/Shorewall/Rules.pm index 2b4c5e9ab..5e5803547 100644 --- a/Shorewall-perl/Shorewall/Rules.pm +++ b/Shorewall-perl/Shorewall/Rules.pm @@ -196,7 +196,7 @@ sub setup_ecn() for my $interface ( @interfaces ) { my $chainref = ensure_chain 'mangle', ecn_chain( $interface ); - add_rule $mangle_table->{PREROUTING}, "-p tcp -o $interface -j $chainref->{name}"; + add_rule $mangle_table->{POSTROUTING}, "-p tcp -o $interface -j $chainref->{name}"; add_rule $mangle_table->{OUTPUT}, "-p tcp -o $interface -j $chainref->{name}"; }