From 36096dfff7f94bae225aa2718a4291dbde16bd53 Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 1 Jan 2008 17:47:58 +0000 Subject: [PATCH] Express mark test mask in Hex git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7984 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Chains.pm | 2 +- Shorewall-perl/Shorewall/Config.pm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 247751fb0..71f881053 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -1152,7 +1152,7 @@ sub do_test ( $$ ) validate_mark $testval; - $testval = join('/', $testval, $mask ) unless ( $testval =~ '/' ); + $testval = join('/', $testval, in_hex($mask) ) unless ( $testval =~ '/' ); "$match $testval "; } diff --git a/Shorewall-perl/Shorewall/Config.pm b/Shorewall-perl/Shorewall/Config.pm index ca13edb87..88837205b 100644 --- a/Shorewall-perl/Shorewall/Config.pm +++ b/Shorewall-perl/Shorewall/Config.pm @@ -55,6 +55,7 @@ our @EXPORT_OK = qw( $shorewall_dir initialize read_a_line1 set_config_path shor our %EXPORT_TAGS = ( internal => [ qw( create_temp_object finalize_object numeric_value + in_hex emit emit_unindented save_progress_message @@ -510,6 +511,10 @@ sub numeric_value ( $ ) { $mark =~ /^0/ ? oct $mark : $mark; } +sub in_hex( $ ) { + sprintf '0x%x', $_[0]; +} + # # Write the arguments to the object file (if any) with the current indentation. #