]> git.karo-electronics.de Git - mv-sheeva.git/commit
[DCCP] tfrc: Add protection against invalid parameters to TFRC routines
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Sun, 3 Dec 2006 16:52:26 +0000 (14:52 -0200)
committerArnaldo Carvalho de Melo <acme@mandriva.com>
Sun, 3 Dec 2006 16:52:26 +0000 (14:52 -0200)
commit8d0086adac0041de66b5f41b77eec0d8d239e16c
tree9830f9188a9ba57bf75c0fa7c2246866f8a8789a
parent90fb0e60dd9178dbca2e42c682c483cdb7ea9f2d
[DCCP] tfrc: Add protection against invalid parameters to TFRC routines

 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: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
net/dccp/ccids/lib/tfrc_equation.c