Revert "BUG/MINOR: dns: SRV records ignores duplicated AR records"
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 12 Jan 2021 09:27:26 +0000 (10:27 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Jan 2021 12:41:10 +0000 (13:41 +0100)
commitaddba8f9601deabd359011b93d53fd5050248e75
tree1d8fa6634230f153c257731daccfedeb1ffc2b85
parent648b4bde66a37faaedff10638432052fc84ac3d4
Revert "BUG/MINOR: dns: SRV records ignores duplicated AR records"

This reverts commit 949a7f64591458eb06c998acf409093ea991dc3a.

The first part of the patch introduces a bug. When a dns answer item is
allocated, its <ar_item> is only initialized at the end of the parsing, when
the item is added in the answer list. Thus, we must not try to release it
during the parsing.

The second part is also probably buggy. It fixes the issue #971 but reverts
a fix for the issue #841 (see commit fb0884c8297 "BUG/MEDIUM: dns: Don't
store additional records in a linked-list"). So it must be at least
revalidated.

This revert fixes a segfault reported in a comment of the issue #971. It
must be backported as far as 2.2.

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