mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-01 03:53:40 +01:00
Remove some crudeness from the traffic shaping code
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7838 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
9f7cfc8489
commit
cf4b54e762
@ -324,21 +324,22 @@ sub validate_tc_device( $$$$ ) {
|
|||||||
fatal_error "Duplicate device ($device)" if $tcdevices{$device};
|
fatal_error "Duplicate device ($device)" if $tcdevices{$device};
|
||||||
fatal_error "Invalid device name ($device)" if $device =~ /[:+]/;
|
fatal_error "Invalid device name ($device)" if $device =~ /[:+]/;
|
||||||
|
|
||||||
$tcdevices{$device} = {};
|
my $classify = 0;
|
||||||
$tcdevices{$device}{in_bandwidth} = rate_to_kbit( $inband ) . 'kbit';
|
|
||||||
$tcdevices{$device}{out_bandwidth} = rate_to_kbit( $outband ) . 'kbit';
|
|
||||||
$tcdevices{$device}{classify} = 0;
|
|
||||||
|
|
||||||
if ( $options ne '-' ) {
|
if ( $options ne '-' ) {
|
||||||
for my $option ( split /,/, $options ) {
|
for my $option ( split /,/, $options ) {
|
||||||
if ( $option eq 'classify' ) {
|
if ( $option eq 'classify' ) {
|
||||||
$tcdevices{$device}{classify} = 1;
|
$classify = 1;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Unknown device option ($option)";
|
fatal_error "Unknown device option ($option)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tcdevices{$device} = { in_bandwidth => rate_to_kbit( $inband ) . 'kbit' ,
|
||||||
|
out_bandwidth => rate_to_kbit( $outband ) . 'kbit' ,
|
||||||
|
classify => $classify };
|
||||||
|
|
||||||
push @tcdevices, $device;
|
push @tcdevices, $device;
|
||||||
|
|
||||||
progress_message " Tcdevice \"$currentline\" $done.";
|
progress_message " Tcdevice \"$currentline\" $done.";
|
||||||
|
Loading…
Reference in New Issue
Block a user