From: Aurelien DARRAGON Date: Mon, 11 Dec 2023 08:15:11 +0000 (+0100) Subject: MINOR: server: ensure connection cleanup on server addr changes X-Git-Tag: v3.0-dev1~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e3a163e47fa26c497c5e0eca7c1912381e3ca0c;p=thirdparty%2Fhaproxy.git MINOR: server: ensure connection cleanup on server addr changes Previously, in srv_update_addr_port(), we forced connection cleanup on server changes. This was done in 6318d33ce ("BUG/MEDIUM: connections: force connections cleanup on server changes"). However, there is no reason we shouldn't have done the same in srv_update_addr() function, because the end goal is the same: perform runtime changes on server's address. The purge_conn hint propagated through the INETADDR server event was simply there to keep the original behavior (only purge the connection for events originating from srv_update_addr_port()), but to ensure the address change is handled the same way for both code paths, we simply ignore this hint. --- diff --git a/src/server.c b/src/server.c index 4d204d4f68..6d175f7da5 100644 --- a/src/server.c +++ b/src/server.c @@ -306,9 +306,8 @@ static struct task *server_atomic_sync(struct task *task, void *context, unsigne _srv_set_inetaddr_port(srv, &new_addr, data->safe.next.port.svc, data->safe.next.port.map); - /* propagate the changes */ - if (data->safe.purge_conn) /* force connection cleanup on the given server? */ - srv_cleanup_connections(srv); + /* propagate the changes, force connection cleanup */ + srv_cleanup_connections(srv); srv_set_dyncookie(srv); srv_set_addr_desc(srv, 1); }