]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: counters: ensure that src_{inc,clr}_gpc0 creates a missing entry
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Aug 2015 15:15:20 +0000 (17:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Aug 2015 15:15:20 +0000 (17:15 +0200)
commit0f4eadd4830279f5ee83aa545728fb750f5c8185
treea8921b6edb16d8fc07c7734eebadcd7f7ba9fd1b
parent827752e7ec006ac001d41005666955832832dc83
BUG/MEDIUM: counters: ensure that src_{inc,clr}_gpc0 creates a missing entry

During 1.5-dev20 there was some code refactoring to make the src_* fetch
function use the same code as sc_*. Unfortunately this introduced a
regression where src_* doesn't create an entry anymore if it does not
exist in the table. The reason is that smp_fetch_sc_stkctr() only calls
stktable_lookup_key() while src_inc_*/src_clr_* used to make use of
stktable_update_key() which additionally create the entry if it does
not exist.

There's no point modifying the common function for these two exceptions,
so instead we now have a function dedicated to the creation of this entry
for src_* only. It is called when the entry didn't exist, so that requires
minimal modifications to existing code.

Thanks to Thierry Fournier for helping diagnose the issue.

This fix must be backported to 1.5.
src/stream.c