]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: checks: fix inlining issue on set_srv_agent_[addr,port}
authorWilly Tarreau <w@1wt.eu>
Fri, 28 Jan 2022 08:16:47 +0000 (09:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 28 Jan 2022 18:04:02 +0000 (19:04 +0100)
These functions are declared as external functions in check.h and
as inline functions in check.c. Let's move them as static inline in
check.h. This appeared in 2.4 with the following commits:

  4858fb2e1 ("MEDIUM: check: align agentaddr and agentport behaviour")
  1c921cd74 ("BUG/MINOR: check: consitent way to set agentaddr")

While harmless (it only triggers build warnings with some gcc 4.x),
it should probably be backported where the paches above are present
to keep the code consistent.

include/haproxy/check.h
src/check.c

index fdc447150d12ef0ea2d580d5e3e0030b7da666ec..8a7c8dc64d3c44dd6a4bf9945029925a3f8a5f6e 100644 (file)
@@ -90,8 +90,20 @@ int spoe_prepare_healthcheck_request(char **req, int *len);
 int spoe_handle_healthcheck_response(char *frame, size_t size, char *err, int errlen);
 
 int set_srv_agent_send(struct server *srv, const char *send);
-void set_srv_agent_addr(struct server *srv, struct sockaddr_storage *sk);
-void set_srv_agent_port(struct server *srv, int port);
+
+/* set agent addr and appropriate flag */
+static inline void set_srv_agent_addr(struct server *srv, struct sockaddr_storage *sk)
+{
+       srv->agent.addr = *sk;
+       srv->flags |= SRV_F_AGENTADDR;
+}
+
+/* set agent port and appropriate flag */
+static inline void set_srv_agent_port(struct server *srv, int port)
+{
+       srv->agent.port = port;
+       srv->flags |= SRV_F_AGENTPORT;
+}
 
 /* Use this one only. This inline version only ensures that we don't
  * call the function when the observe mode is disabled.
index f0ae81504d28cc442e9d8dd5d53933a3072398d2..cb1be9b91dad717e9c4b1f6db8565c5cd717db61 100644 (file)
@@ -1983,20 +1983,6 @@ int set_srv_agent_send(struct server *srv, const char *send)
        return 0;
 }
 
-/* set agent addr and appropriate flag */
-inline void set_srv_agent_addr(struct server *srv, struct sockaddr_storage *sk)
-{
-       srv->agent.addr = *sk;
-       srv->flags |= SRV_F_AGENTADDR;
-}
-
-/* set agent port and appropriate flag */
-inline void set_srv_agent_port(struct server *srv, int port)
-{
-       srv->agent.port = port;
-       srv->flags |= SRV_F_AGENTPORT;
-}
-
 /* Parse the "agent-send" server keyword */
 static int srv_parse_agent_send(char **args, int *cur_arg, struct proxy *curpx, struct server *srv,
                                char **errmsg)