From: Willy Tarreau Date: Tue, 19 Oct 2021 09:16:11 +0000 (+0200) Subject: CLEANUP: resolvers: do not export resolv_purge_resolution_answer_records() X-Git-Tag: v2.3.15~26 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=1ba4c97210c2796f60403a2af497bca8376b279e;p=haproxy-2.3.git CLEANUP: resolvers: do not export resolv_purge_resolution_answer_records() 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 (cherry picked from commit aab7593db39e1083a77ac792723623bd9c402273) Signed-off-by: Christopher Faulet --- diff --git a/include/haproxy/dns.h b/include/haproxy/dns.h index a73dafa..ada2a10 100644 --- a/include/haproxy/dns.h +++ b/include/haproxy/dns.h @@ -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); diff --git a/src/dns.c b/src/dns.c index 3d89868..1c62106 100644 --- 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;