From 2e82b139c8cd9bfec9f3ae9a91b485fff99392e0 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 10 Mar 2021 15:54:14 +0100 Subject: [PATCH] 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 --- src/dns.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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; } -- 1.7.10.4