]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
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>
Fri, 12 Mar 2021 15:43:37 +0000 (16:43 +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.

src/resolvers.c

index 7dcb8f8d8ea2a1a2a878ca526f877897400fbd5d..68e3e21788b74765cdff15b6b968de875df4877c 100644 (file)
@@ -1046,8 +1046,7 @@ static int resolv_validate_dns_response(unsigned char *resp, unsigned char *bufe
                }
 
                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(resolv_answer_item_pool, answer_record);
                        answer_record = NULL;
                }
@@ -1239,7 +1238,6 @@ static int resolv_validate_dns_response(unsigned char *resp, unsigned char *bufe
                                        if (tmp_record->ar_item)
                                                pool_free(resolv_answer_item_pool, tmp_record->ar_item);
                                        tmp_record->ar_item = answer_record;
-                                       tmp_record->last_seen = answer_record->last_seen;
                                        answer_record = NULL;
                                        break;
                                }