• G
    [DCCP] tfrc: Add protection against invalid parameters to TFRC routines · 8d0086ad
    Gerrit Renker 提交于
     1) For the forward X_calc lookup, it
        * protects effectively against RTT=0 (this case is possible), by
          returning the maximal lookup value instead of just setting it to 1
        * reformulates the array-bounds exceeded condition: this only happens
          if p is greater than 1E6 (due to the scaling)
        * the case of negative indices can now with certainty be excluded,
          since documentation shows that the formulas are within bounds
        * additional protection against p = 0 (would give divide-by-zero)
    
     2) For the reverse lookup, it warns against
        * protects against exceeding array bounds
        * now returns 0 if f(p) = 0, due to function definition
        * warns about minimal resolution error and returns the smallest table
          value instead of p=0 [this would mask congestion conditions]
    Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
    Acked-by: NIan McDonald <ian.mcdonald@jandi.co.nz>
    Signed-off-by: NArnaldo Carvalho de Melo <acme@mandriva.com>
    8d0086ad
tfrc_equation.c 17.6 KB