Very minor performance tweak

This commit is contained in:
Tom Eastep 2009-08-17 11:22:03 -07:00
parent 89a6d7e5db
commit e756689d0c

View File

@ -77,11 +77,11 @@ sub initialize_package_globals() {
# #
sub generate_script_1() { sub generate_script_1() {
my $date = localtime;
if ( $test ) { if ( $test ) {
emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall-perl\n#"; emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall-perl\n#";
} else { } else {
my $date = localtime;
emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#"; emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#";
if ( $family == F_IPV4 ) { if ( $family == F_IPV4 ) {
copy $globals{SHAREDIRPL} . 'prog.header'; copy $globals{SHAREDIRPL} . 'prog.header';
@ -596,10 +596,10 @@ sub compiler {
require_capability( 'XCONNMARK' , 'HIGH_ROUTE_MARKS=Yes' , 's' ) if $config{HIGH_ROUTE_MARKS}; require_capability( 'XCONNMARK' , 'HIGH_ROUTE_MARKS=Yes' , 's' ) if $config{HIGH_ROUTE_MARKS};
require_capability( 'MANGLE_ENABLED' , 'Traffic Shaping' , 's' ) if $config{TC_ENABLED}; require_capability( 'MANGLE_ENABLED' , 'Traffic Shaping' , 's' ) if $config{TC_ENABLED};
set_command( 'check', 'Checking', 'Checked' ) unless $objectfile; if ( $objectfile ) {
unless ( $command eq 'check' ) {
create_temp_object( $objectfile , $export ); create_temp_object( $objectfile , $export );
} else {
set_command( 'check', 'Checking', 'Checked' );
} }
# #
@ -640,7 +640,7 @@ sub compiler {
enable_object; enable_object;
unless ( $command eq 'check' ) { if ( $objectfile ) {
# #
# Place Header in the object # Place Header in the object
# #
@ -680,7 +680,7 @@ sub compiler {
# #
setup_zone_mss; setup_zone_mss;
unless ( $command eq 'check' ) { if ( $objectfile ) {
emit 'return 0'; emit 'return 0';
pop_indent; pop_indent;
emit '}'; emit '}';
@ -693,8 +693,7 @@ sub compiler {
# #
enable_object; enable_object;
unless ( $command eq 'check' ) { if ( $objectfile ) {
emit( "\n#", emit( "\n#",
'# Setup routing and traffic shaping', '# Setup routing and traffic shaping',
'#', '#',
@ -712,7 +711,7 @@ sub compiler {
# #
setup_tc; setup_tc;
unless ( $command eq 'check' ) { if ( $objectfile ) {
pop_indent; pop_indent;
emit "}\n"; emit "}\n";
} }
@ -773,15 +772,9 @@ sub compiler {
# #
setup_accounting; setup_accounting;
if ( $command eq 'check' ) { if ( $objectfile ) {
if ( $family == F_IPV4 ) {
progress_message3 "Shorewall configuration verified";
} else {
progress_message3 "Shorewall6 configuration verified";
}
} else {
# #
# Generate the zone x zone matrix # Generate the zone by zone matrix
# #
generate_matrix; generate_matrix;
@ -824,6 +817,12 @@ sub compiler {
# And generate the auxilary config file # And generate the auxilary config file
# #
enable_object, generate_aux_config if $export; enable_object, generate_aux_config if $export;
} else {
if ( $family == F_IPV4 ) {
progress_message3 "Shorewall configuration verified";
} else {
progress_message3 "Shorewall6 configuration verified";
}
} }
close_log if $log; close_log if $log;