Skip to content
Snippets Groups Projects
Commit b7758f5b authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Fixes

parent 4ec2dc18
No related branches found
No related tags found
No related merge requests found
......@@ -822,19 +822,19 @@ int dnslib_packet_contains(const dnslib_packet_t *packet,
dnslib_rrset_compare_type_t cmp)
{
for (int i = 0; i < packet->header.ancount; ++i) {
if (packet->answer[i] == rrset) {
if (dnslib_rrset_compare(packet->answer[i], rrset, cmp)) {
return 1;
}
}
for (int i = 0; i < packet->header.nscount; ++i) {
if (packet->authority[i] == rrset) {
if (dnslib_rrset_compare(packet->authority[i], rrset, cmp)) {
return 1;
}
}
for (int i = 0; i < packet->header.arcount; ++i) {
if (packet->additional[i] == rrset) {
if (dnslib_rrset_compare(packet->additional[i], rrset, cmp)) {
return 1;
}
}
......
......@@ -877,7 +877,8 @@ int dnslib_response_add_rrset_answer(dnslib_packet_t *response,
return DNSLIB_ENOMEM;
}
if (check_duplicates && dnslib_packet_contains(response, rrset)) {
if (check_duplicates && dnslib_packet_contains(response, rrset,
DNSLIB_RRSET_COMPARE_PTR)) {
return DNSLIB_EOK;
}
......@@ -919,7 +920,8 @@ int dnslib_response_add_rrset_authority(dnslib_packet_t *response,
return DNSLIB_ENOMEM;
}
if (check_duplicates && dnslib_packet_contains(response, rrset)) {
if (check_duplicates && dnslib_packet_contains(response, rrset,
DNSLIB_RRSET_COMPARE_PTR))) {
return DNSLIB_EOK;
}
......@@ -963,7 +965,8 @@ int dnslib_response_add_rrset_additional(dnslib_packet_t *response,
return DNSLIB_ENOMEM;
}
if (check_duplicates && dnslib_packet_contains(response, rrset)) {
if (check_duplicates && dnslib_packet_contains(response, rrset,
DNSLIB_RRSET_COMPARE_PTR)) {
return DNSLIB_EOK;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment