Merge branch '4.5.6'

This commit is contained in:
Tom Eastep 2012-07-06 12:30:52 -07:00
commit 5616c96745
3 changed files with 22 additions and 18 deletions

View File

@ -1662,7 +1662,7 @@ sub close_file() {
sub have_capability( $ );
#
# Report an error from process_conditional() -- the first argument is the linenumber
# Report an error from process_conditional()
#
sub cond_error( $$$ ) {
$currentfilename = $_[1];
@ -1674,15 +1674,7 @@ sub cond_error( $$$ ) {
# Evaluate an expression in an ?IF or ?ELSIF directive
#
sub evaluate_expression( $$$ ) {
my ( $expression , $filename, $linenumber ) = @_;
if ( $family == F_IPV4 ) {
$expression =~ s/__IPV6/0/g;
$expression =~ s/__IPV4/1/g;
} else {
$expression =~ s/__IPV6/1/g;
$expression =~ s/__IPV4/0/g;
}
my ( $expression , $filename , $linenumber ) = @_;
my $count = 0;
@ -1707,6 +1699,8 @@ sub evaluate_expression( $$$ ) {
my $val;
if ( exists $capdesc{$cap} ) {
$val = have_capability( $cap );
} elsif ( $cap =~ /^IPV([46])$/ ) {
$val = ( $family == $1 )
} else {
cond_error "Unknown capability ($cap)", $filename, $linenumber;
}
@ -1714,11 +1708,23 @@ sub evaluate_expression( $$$ ) {
$expression = join( '', $first, $val, $rest );
}
my $val = eval qq(package Shorewall::User;\nuse strict;\n# line $linenumber "$filename"\n$expression);
my $val;
unless ( $val ) {
cond_error( "Couldn't parse expression: $@" , $filename, $linenumber ) if $@;
cond_error( "Undefined expression" , $filename, $linenumber ) unless defined $val;
if ( $expression =~ /^\s*(\d+)\s*$/ || $expression =~ /\s*'(.*?)'\s*$/ ) {
#
# Simple one-term expression -- don't compile it
#
$val = $1;
} else {
#
# Not a simple one-term expression
#
$val = eval qq(package Shorewall::User;\nuse strict;\n# line $linenumber "$filename"\n$expression);
unless ( $val ) {
cond_error( "Couldn't parse expression: $@" , $filename, $linenumber ) if $@;
cond_error( "Undefined expression" , $filename, $linenumber ) unless defined $val;
}
}
$val;

View File

@ -2160,7 +2160,7 @@ sub setup_tc() {
setup_traffic_shaping if @tcdevices && $config{TC_ENABLED} ne 'Shared';
}
if ( $config{TC_ENABLED} ) {
if ( $config{MANGLE_ENABLED} ) {
our @tccmd = ( { match => sub ( $ ) { $_[0] eq 'SAVE' } ,
target => 'CONNMARK --save-mark --mask' ,
mark => $config{TC_EXPERT} ? HIGHMARK : SMALLMARK,
@ -2254,9 +2254,7 @@ sub setup_tc() {
clear_comment;
}
}
if ( $config{MANGLE_ENABLED} ) {
if ( my $fn = open_file 'secmarks' ) {
first_entry "$doing $fn...";

View File

@ -181,7 +181,7 @@ get_config() {
if [ "$2" = Yes ]; then
case $STARTUP_ENABLED in
No|no|NO)
echo " ERROR: $g_product startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${CONFDIR}/${g_program}.conf" >&2
echo " ERROR: $g_product startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${g_confdir}/${g_program}.conf" >&2
exit 2
;;
Yes|yes|YES)