]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: freq-ctr: Don't report overshoot for long inactivity period
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Nov 2023 18:16:51 +0000 (19:16 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Nov 2023 15:38:06 +0000 (16:38 +0100)
commit5705a6e3b7b310c87f21abaa710da66a0f38108a
treec72f27d9e83f5630eac491ce3b88ca1a9dc578ac
parent2c9c2f9d77b9dac5a32d33838c5bca67f61fb1f5
BUG/MEDIUM: freq-ctr: Don't report overshoot for long inactivity period

The function returning the excess of events over the current period for a
target frequency (the overshoot) has a flaw if the inactivity period is too
long. In this case, the result may overflow. Instead to be negative, a very
high positive value is returned.

This function is used by the bandwidth limitation filter. It means after a
long inactivity period, a huge burst may be detected while it should not.

In fact, the problem arise from the moment we're past the current period. In
this case, we should not report any overshoot and just get the number of
remaining events as usual.

This patch should be backported as far as 2.7.
src/freq_ctr.c