mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-26 01:23:14 +01:00
load= enhancements
- Normalize loads to 0.nnnnnnnn - Issue warning if the loads don't sum to 1.000000 Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
c851e03313
commit
631ebdecb8
@ -568,8 +568,8 @@ sub process_a_provider( $ ) {
|
|||||||
$track = 0 if $config{TRACK_PROVIDERS};
|
$track = 0 if $config{TRACK_PROVIDERS};
|
||||||
$default_balance = 0 if $config{USE_DEFAULT_RT};
|
$default_balance = 0 if $config{USE_DEFAULT_RT};
|
||||||
} elsif ( $option =~ /^load=(0?\.\d{1,8})/ ) {
|
} elsif ( $option =~ /^load=(0?\.\d{1,8})/ ) {
|
||||||
$load = $1;
|
$load = sprintf "%1.8f", $1;
|
||||||
require_capability 'STATISTIC_MATCH', "load=$load", 's';
|
require_capability 'STATISTIC_MATCH', "load=$1", 's';
|
||||||
} elsif ( $option eq 'autosrc' ) {
|
} elsif ( $option eq 'autosrc' ) {
|
||||||
$noautosrc = 0;
|
$noautosrc = 0;
|
||||||
} elsif ( $option eq 'noautosrc' ) {
|
} elsif ( $option eq 'noautosrc' ) {
|
||||||
@ -1620,6 +1620,11 @@ sub setup_providers() {
|
|||||||
our $providers;
|
our $providers;
|
||||||
|
|
||||||
if ( $providers ) {
|
if ( $providers ) {
|
||||||
|
if ( $maxload ) {
|
||||||
|
warning_message "The sum of the provider interface loads exceeds 1.000000" if $maxload > 1;
|
||||||
|
warning_message "The sum of the provider interface loads is less than 1.000000" if $maxload < 1;
|
||||||
|
}
|
||||||
|
|
||||||
emit "\nif [ -z \"\$g_noroutes\" ]; then";
|
emit "\nif [ -z \"\$g_noroutes\" ]; then";
|
||||||
|
|
||||||
push_indent;
|
push_indent;
|
||||||
|
Loading…
Reference in New Issue
Block a user