]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stktable: split sc_ and src_ fetch lookup logics
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 14 Jan 2025 09:11:54 +0000 (10:11 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 15 Jan 2025 13:04:50 +0000 (14:04 +0100)
commit6c9b315187c57986321fded0b5b77a1bf37fcc51
tree54e4ea7abe8d1a8084f7e8882f7266a63ab65b5b
parent22229a41a294d6ba2a406ab8e8cd28a464dc4018
MEDIUM: stktable: split sc_ and src_ fetch lookup logics

While this patch actually adds more insertions than deletions, it actually
tries to simplify the lookup logic for sc_ and src_ sticktable fetches.

Indeed, smp_create_src_stkctr() and smp_fetch_sc_stkctr() combination
was used everywhere the fetch supports sc_ and src_ form, and
smp_fetch_sc_stkctr() even integrated some of the src-oriented fetch logic.

Not only this was confusing, but it made the task of adding new generic
fetches even more complex.

Thus in this patch we completely dedicate smp_fetch_sc_stkctr() to sc_
oriented fetches, while smp_create_src_stkctr() is now renamed to
smp_fetch_src_stkctr() and can now work on its own for src_ oriented
fetches. It takes an additional paramater, "create" to tell the function
if the entry should be created if it doesn't exist yet.

Now it's up to the calling function to know if it should be using the
sc_ oriented fetch or the src_ oriented one based on the input keyword.
src/stick_table.c