Correct handling of {+-}0 in the TTL and HL tcrule actions.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-09-24 07:14:44 -07:00
parent e1309b06b1
commit cf130a7e16

View File

@ -394,11 +394,11 @@ sub process_tc_rule( ) {
}
}
$cmd =~ /^TTL\(([-+]?\d+)\)$/;
$cmd =~ /^TTL\(([-+]?(\d+))\)$/;
my $param = $1;
fatal_error "Invalid TTL specification( $cmd )" unless $param && ( $param = abs $param ) < 256;
fatal_error "Invalid TTL specification( $cmd )" unless $2 && ( $param = abs $param ) < 256;
if ( $1 =~ /^\+/ ) {
$target .= " --ttl-inc $param";
@ -422,11 +422,11 @@ sub process_tc_rule( ) {
}
}
$cmd =~ /^HL\(([-+]?\d+)\)$/;
$cmd =~ /^HL\(([-+]?(\d+))\)$/;
my $param = $1;
fatal_error "Invalid HL specification( $cmd )" unless $param && ( $param = abs $param ) < 256;
fatal_error "Invalid HL specification( $cmd )" unless $2 && ( $param = abs $param ) < 256;
if ( $1 =~ /^\+/ ) {
$target .= " --hl-inc $param";