From: Christopher Faulet Date: Wed, 10 Mar 2021 14:54:14 +0000 (+0100) Subject: Revert "BUG/MINOR: resolvers: Only renew TTL for SRV records with an additional record" X-Git-Tag: v2.3.7~18 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=2e82b139c8cd9bfec9f3ae9a91b485fff99392e0;p=haproxy-2.3.git Revert "BUG/MINOR: resolvers: Only renew TTL for SRV records with an additional record" This reverts commit a331a1e8eb2ad4750711a477ca3e22d940495faf. This commit fixes a real bug, but it also reveals some hidden bugs, mostly because of some design issues. Thus, in itself, it create more problem than it solves. So revert it for now. All known bugs will be addressed in next commits. This patch should be backported as far as 2.2. (cherry picked from commit 5037c06d91e0ed748932fcfaae11eeadf5949957) Signed-off-by: Christopher Faulet --- diff --git a/src/dns.c b/src/dns.c index fa1a246..da0076d 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1099,8 +1099,7 @@ static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, } if (found == 1) { - if (tmp_record->type != DNS_RTYPE_SRV || tmp_record->ar_item != NULL) - tmp_record->last_seen = now.tv_sec; + tmp_record->last_seen = now.tv_sec; pool_free(dns_answer_item_pool, dns_answer_record); dns_answer_record = NULL; } @@ -1290,7 +1289,6 @@ static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, !dns_hostname_cmp(tmp_record->target, dns_answer_record->name, tmp_record->data_len)) { /* Always use the received additional record to refresh info */ tmp_record->ar_item = dns_answer_record; - tmp_record->last_seen = dns_answer_record->last_seen; dns_answer_record = NULL; break; }