BUG/MEDIUM: resolvers: Fix the loop looking for an existing ADD item
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Mar 2021 14:19:57 +0000 (15:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 16 Mar 2021 08:15:39 +0000 (09:15 +0100)
commitb8e928194a911c6dfd84d1a2baadca520be9fdd7
tree8837c49cc80755b010f5a1483f82360fb9b3fb6a
parent1ec9077f8678dcf13ef89b57e8afccbf63e4e140
BUG/MEDIUM: resolvers: Fix the loop looking for an existing ADD item

For each ADD item found in a SRV response, we try to find a corresponding
ADD item already attached to an existing SRV item. If found, the ADD
last_seen time is updated, otherwise we try to find a SRV item with no ADD
to attached the new one.

However, the loop is buggy. Instead of comparing 2 ADD items, it compares
the new ADD item with the SRV item. Because of this bug, we are unable to
renew last_seen time of existing ADD.

This patch must be backported as far as 2.2.

(cherry picked from commit 77f860699c17426ee6e727fa07a287b32276f1dd)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/dns.c