From ab6fef4882ca12b4820842a1293b554985a86ae1 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Thu, 7 Dec 2023 15:55:31 +0100 Subject: [PATCH] CLEANUP: server: remove unused server_parse_addr_change_request() function server_parse_addr_change_request() was completely replaced by the newer srv_update_addr_port() function. Considering the function doesn't offer useful features that srv_update_addr_port() couldn't do, we simply remove the function. --- include/haproxy/server.h | 8 -------- src/server.c | 26 -------------------------- 2 files changed, 34 deletions(-) diff --git a/include/haproxy/server.h b/include/haproxy/server.h index c85329b39..fe78e2b72 100644 --- a/include/haproxy/server.h +++ b/include/haproxy/server.h @@ -122,14 +122,6 @@ void server_recalc_eweight(struct server *sv, int must_update); const char *server_parse_weight_change_request(struct server *sv, const char *weight_str); -/* - * Parses addr_str and configures sv accordingly. updater precise - * the source of the change in the associated message log. - * Returns NULL on success, error message string otherwise. - */ -const char *server_parse_addr_change_request(struct server *sv, - const char *addr_str, const char *updater); - /* * Parses maxconn_str and configures sv accordingly. * Returns NULL on success, error message string otherwise. diff --git a/src/server.c b/src/server.c index 5af5e37a0..1c8854af3 100644 --- a/src/server.c +++ b/src/server.c @@ -2327,32 +2327,6 @@ const char *server_parse_weight_change_request(struct server *sv, return NULL; } -/* - * Parses and configures accordingly. precise - * the source of the change in the associated message log. - * Returns: - * - error string on error - * - NULL on success - * - * Must be called with the server lock held. - */ -const char *server_parse_addr_change_request(struct server *sv, - const char *addr_str, const char *updater) -{ - unsigned char ip[INET6_ADDRSTRLEN]; - - if (inet_pton(AF_INET6, addr_str, ip)) { - srv_update_addr(sv, ip, AF_INET6, updater); - return NULL; - } - if (inet_pton(AF_INET, addr_str, ip)) { - srv_update_addr(sv, ip, AF_INET, updater); - return NULL; - } - - return "Could not understand IP address format.\n"; -} - /* * Must be called with the server lock held. */ -- 2.47.3