]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: pattern/ip: simplify pat_match_ip() function
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 6 Sep 2023 09:32:54 +0000 (11:32 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Sep 2023 07:50:56 +0000 (09:50 +0200)
commit0189a4679e25929b87fe37eea5c02d0c59a73440
tree9af326e42caf29d1054276b7dd128710fef50bd0
parentacb7d8a89cb16836b5764607a13fd1759427ae7e
MINOR: pattern/ip: simplify pat_match_ip() function

pat_match_ip() has been updated several times over the last decade to
introduce new features, but it was never cleaned up.

The result is that the function is pretty hard to read, and there are
multiple duplicated code blocks so it becomes error-prone to maintain it,
plus it bloats the haproxy binary for nothing.

In this patch, we move the tree search (ip4 / ip6) logic into 2
dedicated helper functions. This allows us to refactor pat_match_ip()
without touching to the original behavior.
src/pattern.c