From 2acc160c05c0c8dc28ecce5941451c916d29bc63 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 19 Oct 2021 11:16:11 +0200 Subject: [PATCH] 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. --- include/haproxy/resolvers.h | 1 - src/resolvers.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/haproxy/resolvers.h b/include/haproxy/resolvers.h index 70211a82b..6030bb662 100644 --- a/include/haproxy/resolvers.h +++ b/include/haproxy/resolvers.h @@ -48,7 +48,6 @@ int resolv_get_ip_from_response(struct resolv_response *r_res, void **newip, short *newip_sin_family, struct server *owner); -void resolv_purge_resolution_answer_records(struct resolv_resolution *resolution); int resolv_link_resolution(void *requester, int requester_type, int requester_locked); void resolv_unlink_resolution(struct resolv_requester *requester, int safe); void resolv_detach_from_resolution_answer_items(struct resolv_resolution *res, struct resolv_requester *req, int safe); diff --git a/src/resolvers.c b/src/resolvers.c index 44305fc40..15895d580 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -1786,7 +1786,8 @@ static struct resolv_resolution *resolv_pick_resolution(struct resolvers *resolv return res; } -void resolv_purge_resolution_answer_records(struct resolv_resolution *resolution) +/* deletes and frees all answer_items from the resolution's answer_list */ +static void resolv_purge_resolution_answer_records(struct resolv_resolution *resolution) { struct resolv_answer_item *item, *itemback;