mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
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.
This commit is contained in:
parent
76603f2552
commit
a1eea3bbb1
@ -1027,10 +1027,6 @@ static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend,
|
||||
dns_answer_record->data_len = len;
|
||||
memcpy(dns_answer_record->target, tmpname, len);
|
||||
dns_answer_record->target[len] = 0;
|
||||
if (dns_answer_record->ar_item != NULL) {
|
||||
pool_free(dns_answer_item_pool, dns_answer_record->ar_item);
|
||||
dns_answer_record->ar_item = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case DNS_RTYPE_AAAA:
|
||||
@ -1280,7 +1276,6 @@ static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend,
|
||||
// looking for the SRV record in the response list linked to this additional record
|
||||
list_for_each_entry(tmp_record, &dns_p->answer_list, list) {
|
||||
if (tmp_record->type == DNS_RTYPE_SRV &&
|
||||
tmp_record->ar_item == NULL &&
|
||||
!dns_hostname_cmp(tmp_record->target, dns_answer_record->name, tmp_record->data_len)) {
|
||||
/* Always use the received additional record to refresh info */
|
||||
if (tmp_record->ar_item)
|
||||
|
Loading…
x
Reference in New Issue
Block a user