Fix several issues with IPv6 tcfilters

This commit is contained in:
Tom Eastep 2011-02-03 08:28:00 -08:00
parent 27a2b32e9e
commit 953c0b48de
2 changed files with 13 additions and 3 deletions

View File

@ -280,7 +280,7 @@ sub decompose_net( $ ) {
my $net = $_[0];
( $net, my $vlsm ) = validate_net( $net , 0 );
( encodeaddr( $net) , $vlsm );
( ( $family == F_IPV4 ? encodeaddr( $net) : $net ) , $vlsm );
}
@ -587,6 +587,15 @@ sub validate_6net( $$ ) {
fatal_error "Invalid Network address ($_[0])" if $_[0] =~ '/' || ! defined $net;
validate_6address $net, $allow_name;
}
if ( defined wantarray ) {
assert ( ! $allow_name );
if ( wantarray ) {
( $net , $vlsm );
} else {
"$net/$vlsm";
}
}
}
#

View File

@ -806,7 +806,8 @@ sub validate_tc_class( ) {
#
$parentref = $tcref->{$parentclass};
fatal_error "Unknown Parent class ($parentclass)" unless $parentref && $parentref->{occurs} == 1;
fatal_error "The parent class ($parentclass) specifies UMAX and/or DMAX; it cannot serve as a parent" if $parentref->{dmax};
fatal_error "The class ($parentclass) specifies UMAX and/or DMAX; it cannot serve as a parent" if $parentref->{dmax};
fatal_error "The class ($parentclass) specifies flow; it cannot serve as a parent" if $parentref->{flow};
$parentref->{leaf} = 0;
$ratemax = $parentref->{rate};
$ratename = q(the parent class's RATE);
@ -980,7 +981,7 @@ sub process_tc_filter() {
if ( $dest ne '-' ) {
my ( $net , $mask ) = decompose_net( $dest );
$rule .= "\\\n match $ip dst $net/$mask";
$rule .= "\\\n match $ip32 dst $net/$mask";
}
if ( $tos ne '-' ) {