CLEANUP: resolvers: do not export resolv_purge_resolution_answer_records()
authorWilly Tarreau <w@1wt.eu>
Tue, 19 Oct 2021 09:16:11 +0000 (11:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Nov 2021 10:59:21 +0000 (11:59 +0100)
This code is dangerous enough that we certainly don't want external code
to ever approach it, let's not export unnecessary functions like this one.
It was made static and a comment was added about its purpose.

(cherry picked from commit 2acc160c05c0c8dc28ecce5941451c916d29bc63)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit aab7593db39e1083a77ac792723623bd9c402273)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

include/haproxy/dns.h
src/dns.c

index a73dafa..ada2a10 100644 (file)
@@ -43,7 +43,6 @@ int dns_get_ip_from_response(struct dns_response_packet *dns_p,
                              void **newip, short *newip_sin_family,
                              struct server *owner);
 
-void dns_purge_resolution_answer_records(struct dns_resolution *resolution);
 int dns_link_resolution(void *requester, int requester_type, int requester_locked);
 void dns_unlink_resolution(struct dns_requester *requester, int safe);
 void dns_detach_from_resolution_answer_items(struct dns_resolution *res,  struct dns_requester *req, int safe);
index 3d89868..1c62106 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -1877,7 +1877,8 @@ static struct dns_resolution *dns_pick_resolution(struct dns_resolvers *resolver
        return res;
 }
 
-void dns_purge_resolution_answer_records(struct dns_resolution *resolution)
+/* deletes and frees all answer_items from the resolution's answer_list */
+static void dns_purge_resolution_answer_records(struct dns_resolution *resolution)
 {
        struct dns_answer_item *item, *itemback;