mirror of
https://gitlab.com/shorewall/code.git
synced 2025-03-05 10:02:19 +01:00
Add :<burst> to /etc/shorewall/tcdevices
This commit is contained in:
parent
69a2fa1907
commit
ba89ec39b5
@ -1307,11 +1307,26 @@ sub setup_traffic_shaping() {
|
|||||||
qq(fi) );
|
qq(fi) );
|
||||||
}
|
}
|
||||||
|
|
||||||
my $inband = rate_to_kbit $devref->{in_bandwidth};
|
my $in_burst = '10kb';
|
||||||
|
my $inband;
|
||||||
|
|
||||||
|
if ( $devref->{in_bandwidth} =~ /:/ ) {
|
||||||
|
my ( $in_band, $burst ) = split /:/, $devref->{in_bandwidth}, 2;
|
||||||
|
|
||||||
|
if ( defined $burst && $burst ne '' ) {
|
||||||
|
fatal_error "Invalid IN-BANDWIDTH" if $burst =~ /:/;
|
||||||
|
fatal_error "Invalid burst ($burst)" unless $burst =~ /^\d+(k|kb|m|mb|mbit|kbit|b)?$/;
|
||||||
|
$in_burst = $burst;
|
||||||
|
}
|
||||||
|
|
||||||
|
$inband = rate_to_kbit( $in_band );
|
||||||
|
} else {
|
||||||
|
$inband = rate_to_kbit $devref->{in_bandwidth};
|
||||||
|
}
|
||||||
|
|
||||||
if ( $inband ) {
|
if ( $inband ) {
|
||||||
emit ( "run_tc qdisc add dev $device handle ffff: ingress",
|
emit ( "run_tc qdisc add dev $device handle ffff: ingress",
|
||||||
"run_tc filter add dev $device parent ffff: protocol all prio 10 u32 match ip src 0.0.0.0/0 police rate ${inband}kbit burst 10kb drop flowid :1"
|
"run_tc filter add dev $device parent ffff: protocol all prio 10 u32 match ip src 0.0.0.0/0 police rate ${inband}kbit burst $in_burst drop flowid :1"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user