]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: server: remove unused server_parse_addr_change_request() function
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Dec 2023 14:55:31 +0000 (15:55 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Dec 2023 13:22:27 +0000 (14:22 +0100)
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
src/server.c

index c85329b399e1e4ba0d8db8ea4178f3f29e015d53..fe78e2b726a91beacf80ba212b38bbd771460661 100644 (file)
@@ -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.
index 5af5e37a0e8a7c4c2b1022f7ddf1a87ef6e13e92..1c8854af3c1e0d088705ca4f8504b141cf139cea 100644 (file)
@@ -2327,32 +2327,6 @@ const char *server_parse_weight_change_request(struct server *sv,
        return NULL;
 }
 
-/*
- * Parses <addr_str> and configures <sv> accordingly. <from> 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.
  */