From: Aurelien DARRAGON Date: Thu, 7 Dec 2023 14:55:31 +0000 (+0100) Subject: CLEANUP: server: remove unused server_parse_addr_change_request() function X-Git-Tag: v3.0-dev1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab6fef4882ca12b4820842a1293b554985a86ae1;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/haproxy/server.h b/include/haproxy/server.h index c85329b399..fe78e2b726 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 5af5e37a0e..1c8854af3c 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. */