From 6803ce5d4167444c9fbb01eecf80c62cd23247b3 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 1 Jul 2013 15:36:16 -0700 Subject: [PATCH] Add constants for %used values. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 381199ba3..e12a27f47 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -393,6 +393,10 @@ our %capdesc = ( NAT_ENABLED => 'NAT', our %used; +use constant { + USED => 1, + REQUIRED => 2 }; + use constant { ICMP => 1, TCP => 6, @@ -5105,9 +5109,9 @@ sub get_configuration( $$$$ ) { if ( have_capability 'CONNTRACK_MATCH') { $globals{STATEMATCH} = '-m conntrack --ctstate'; - $used{CONNTRACK_MATCH} = 2; + $used{CONNTRACK_MATCH} = REQUIRED; } else { - $used{STATE_MATCH} = 2; + $used{STATE_MATCH} = REQUIRED; } # # The following is not documented as it is not likely useful to the user base in general @@ -5926,7 +5930,7 @@ sub report_used_capabilities() { progress_message2 "Configuration uses these capabilities ('*' denotes required):"; for ( sort grep $_ ne 'KERNELVERSION', keys %used ) { - if ( $used{$_} > 1 ) { + if ( ( $used{$_} || 0 ) & REQUIRED ) { progress_message2 " $_*"; } else { progress_message2 " $_";