Ignore:
Timestamp:
2010-05-10T17:19:34+02:00 (6 years ago)
Author:
craigc
Message:

[packages] multiwan: Tweaked probability for random packet selection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/multiwan/files/usr/bin/multiwan

    r21414 r21415  
    637637local pre_nexthop_chk 
    638638local rand_probability 
     639local last_probability 
    639640local total_weight 
    640641local i 
     
    658659 
    659660total_weight=0 
     661last_probability=0 
    660662 
    661663iptables -F MultiWanLoadBalancer -t mangle 
     
    686688if [ "$gateway" != "x" -a "$ifname" != "x" -a "$failchk" != "x" -a "$weight" != "disable" ]; then 
    687689nexthop="$nexthop nexthop via $gateway dev $ifname weight $weight" 
    688 rand_probability=$(expr $(expr $weight \* 100) / $total_weight) 
     690rand_probability=$(expr $(expr $weight \* 100) / $total_weight + $last_probability) 
     691last_probability=$rand_probability 
    689692 
    690693        if [ $rand_probability -lt 10 ]; then 
Note: See TracChangeset for help on using the changeset viewer.