From ee0667c9dab65030bfa1568fc0071915555ad0bc Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 12 Jun 2009 07:27:08 -0700 Subject: [PATCH] Fix mnemonic handling in tcfilters --- Shorewall/Perl/Shorewall/Tc.pm | 17 +++++++++++------ Shorewall/changelog.txt | 2 ++ Shorewall/releasenotes.txt | 3 +++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm index e3c34f9a6..94c63423b 100644 --- a/Shorewall/Perl/Shorewall/Tc.pm +++ b/Shorewall/Perl/Shorewall/Tc.pm @@ -820,18 +820,23 @@ sub process_tc_filter( ) { if ( $tos ne '-' ) { my $tosval = $tosoptions{$tos}; my $mask; - $tos = $tosval if $tosval; - if ( $tos =~ /^0x[0-9a-f]{2}$/ ) { + if ( $tosval ) { + $tosval =~ s/^tos=//; + } else { + $tosval = $tos; + } + + if ( $tosval =~ /^0x[0-9a-f]{2}$/ ) { $mask = '0xff'; - } elsif ( $tos =~ /^(0x[0-9a-f]{2})\/(0x[0-9a-f]{2})$/ ) { - $tos = $1; - $mask = $2; + } elsif ( $tosval =~ /^(0x[0-9a-f]{2})\/(0x[0-9a-f]{2})$/ ) { + $tosval = $1; + $mask = $2; } else { fatal_error "Invalid TOS ($tos)"; } - $rule .= "\\\n match ip tos $tos $mask"; + $rule .= "\\\n match ip tos $tosval $mask"; } if ( $length ne '-' ) { diff --git a/Shorewall/changelog.txt b/Shorewall/changelog.txt index d618047e4..8bfce9d6f 100644 --- a/Shorewall/changelog.txt +++ b/Shorewall/changelog.txt @@ -2,6 +2,8 @@ Changes in Shorewall 4.3.13 1) Correct typo in Shorewall6 two-interface sample shorewall.conf. +2) Fix TOS mnemonic handling in /etc/shorewall/tcfilters. + Changes in Shorewall 4.3.12 1) Eliminate 'large quantum' warnings. diff --git a/Shorewall/releasenotes.txt b/Shorewall/releasenotes.txt index 3bcf35aff..ca4702b87 100644 --- a/Shorewall/releasenotes.txt +++ b/Shorewall/releasenotes.txt @@ -111,6 +111,9 @@ released late in 2009. 1) A typo in the IPv6 two-interface Sample shorewall6.conf file has been corrected. +2) When a valid mnemonic such as 'tos-minimize-delay' appeared in the TOS + column of /etc/shorewall/tcfilters, a compile-time error resulted. + ---------------------------------------------------------------------------- K N O W N P R O B L E M S R E M A I N I N G ----------------------------------------------------------------------------