Revert "BUG/MINOR: resolvers: Only renew TTL for SRV records with an additional record"
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Mar 2021 14:54:14 +0000 (15:54 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 16 Mar 2021 08:06:36 +0000 (09:06 +0100)
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 <cfaulet@haproxy.com>

src/dns.c

index fa1a246..da0076d 100644 (file)
--- 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;
                                }