From: Amaury Denoyelle Date: Fri, 7 May 2021 13:12:20 +0000 (+0200) Subject: MINOR: proxy: define PR_CAP_LB X-Git-Tag: v2.4-dev19~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b979f59871e1c7ff33716d0ac5d31f0efa70fa9e;p=thirdparty%2Fhaproxy.git MINOR: proxy: define PR_CAP_LB Add a new proxy capability for proxy with load-balancing capabilities. This help to differentiate listen/frontend/backend with special proxies such as peer proxies. --- diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index 02d1391df2..95d3bc978f 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -69,6 +69,7 @@ enum PR_SRV_STATE_FILE { #define PR_CAP_LISTEN (PR_CAP_FE|PR_CAP_BE) #define PR_CAP_DEF 0x0004 /* defaults section */ #define PR_CAP_LUA 0x0008 /* internal proxy used by lua engine */ +#define PR_CAP_LB 0x0010 /* load-balancing capabilities, i.e. listen/frontend/backend proxies */ /* bits for proxy->options */ #define PR_O_REDISP 0x00000001 /* allow reconnection to dispatch in case of errors */ diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index 525da58909..d5df78c516 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -223,11 +223,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) } if (strcmp(args[0], "listen") == 0) - rc = PR_CAP_LISTEN; + rc = PR_CAP_LISTEN | PR_CAP_LB; else if (strcmp(args[0], "frontend") == 0) - rc = PR_CAP_FE; + rc = PR_CAP_FE | PR_CAP_LB; else if (strcmp(args[0], "backend") == 0) - rc = PR_CAP_BE; + rc = PR_CAP_BE | PR_CAP_LB; else if (strcmp(args[0], "defaults") == 0) { /* "defaults" must first delete the last no-name defaults if any */ proxy_destroy_defaults(proxy_find_by_name("", PR_CAP_DEF, 0));