diff --git a/Shorewall/Perl/lib.core b/Shorewall/Perl/lib.core index a76b3aeaf..78a7a962e 100644 --- a/Shorewall/Perl/lib.core +++ b/Shorewall/Perl/lib.core @@ -604,11 +604,12 @@ interface_enabled() { distribute_load() { local interface - local currentload - local load - local mark - local totalload - local temp + local currentload # Total load of enabled interfaces + local load # Specified load of an enabled interface + local mark # Mark of an enabled interface + local totalload # Total load of all interfaces - usually 1.000000 + local nload # Normalized load of an enabled interface + local var # Interface name to embed in a variable name totalload=$1 shift @@ -617,10 +618,11 @@ distribute_load() { for interface in $@; do if interface_enabled $interface; then + var=$(echo $interface | sed 's/[.-]/_/g') load=$(cat ${VARDIR}/${interface}_load) - eval ${interface}_load=$load + eval ${var}_load=$load mark=$(cat ${VARDIR}/${interface}_mark) - eval ${interface}_mark=$mark + eval ${var}_mark=$mark currentload=$( bc <