From 37ebe1212bf97ad9c6bc5b45247d19bd8d68c402 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 4 Nov 2016 15:17:58 +0100 Subject: [PATCH] MINOR: server: implement init-addr none The server is put into the "no address" maintenance state in this case. --- src/server.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server.c b/src/server.c index b4d4f5079..b99691430 100644 --- a/src/server.c +++ b/src/server.c @@ -1182,8 +1182,11 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr else if (!strcmp(p, "last")) { done = srv_append_initaddr(&newsrv->init_addr_methods, SRV_IADDR_LAST); } + else if (!strcmp(p, "none")) { + done = srv_append_initaddr(&newsrv->init_addr_methods, SRV_IADDR_NONE); + } else { - Alert("parsing [%s:%d]: '%s' : unknown init-addr method '%s', supported methods are 'libc', 'last'.\n", + Alert("parsing [%s:%d]: '%s' : unknown init-addr method '%s', supported methods are 'libc', 'last', 'none'.\n", file, linenum, args[cur_arg], p); err_code |= ERR_ALERT | ERR_FATAL; goto out; @@ -3255,6 +3258,10 @@ static int srv_iterate_initaddr(struct server *srv) return_code |= err_code; break; + case SRV_IADDR_NONE: + srv_set_admin_flag(srv, SRV_ADMF_RMAINT, NULL); + return return_code; + default: /* unhandled method */ break; }