mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-14 06:29:10 +02:00
Revert "BUG/MINOR: dns: SRV records ignores duplicated AR records"
This reverts commit 949a7f6459.
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user