]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: new server flag: SRV_F_FORCED_ID
authorBaptiste Assmann <bedis9@gmail.com>
Tue, 7 Jul 2015 20:02:20 +0000 (22:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Jul 2015 21:24:16 +0000 (23:24 +0200)
This flag aims at reporting whether the server unique id (srv->puid) has
been forced by the administrator in HAProxy's configuration.
If not set, it means HAProxy has generated automatically the server's
unique id.

include/types/server.h
src/server.c

index 6a7e5586cfed3b457d0db2ac5b849e0dd586180a..130c370f7a0230fcb8ad8db0f18481acb4770195 100644 (file)
@@ -86,6 +86,7 @@ enum srv_admin {
 #define SRV_F_MAPPORTS     0x0002        /* this server uses mapped ports */
 #define SRV_F_NON_STICK    0x0004        /* never add connections allocated to this server to a stick table */
 #define SRV_F_USE_NS_FROM_PP 0x0008      /* use namespace associated with connection if present */
+#define SRV_F_FORCED_ID    0x0010        /* server's ID was forced in the configuration */
 
 /* configured server options for send-proxy (server->pp_opts) */
 #define SRV_PP_V1          0x0001        /* proxy protocol version 1 */
index ee52903f6e889990508d96c644d675f55073d506..901967421f51ecde3e00ac92ce709a79f88e9060 100644 (file)
@@ -161,6 +161,7 @@ static int srv_parse_id(char **args, int *cur_arg, struct proxy *curproxy, struc
        }
 
        eb32_insert(&curproxy->conf.used_server_id, &newsrv->conf.id);
+       newsrv->flags |= SRV_F_FORCED_ID;
        return 0;
 }