From 7bf3020952952bd2fbe8cce0f2bdf16bc0caf259 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 6 Jan 2026 16:38:05 +0100 Subject: [PATCH] MINOR: proxy: prevent backend removal when unsupported Prevent removal of a backend which relies on features not compatible with dynamic backends. This is the case if either dispatch or transparent option is used, or if a stick-table is declared. These limitations are similar to the "add backend" ones. --- doc/management.txt | 5 +++++ src/proxy.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/management.txt b/doc/management.txt index 57179611e..ec9e1164d 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -2130,6 +2130,11 @@ del backend This operation is only possible for TCP or HTTP proxies. To succeed, the backend instance must have been first unpublished. + There is also additional restrictions which prevent backend removal. + Currently, this is the case when deprecated dispatch or option transparent + are used. Also, a backend cannot be removed if there is a stick-table + declared in it. + This command is restricted and can only be issued on sockets configured for level "admin". Moreover, this feature is still considered in development so it also requires experimental mode (see "experimental-mode on"). diff --git a/src/proxy.c b/src/proxy.c index adbbd63f1..7dde62887 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -5014,6 +5014,16 @@ int be_check_for_deletion(const char *bename, struct proxy **pb, const char **pm goto out; } + if (be->options & (PR_O_DISPATCH|PR_O_TRANSP)) { + msg = "Deletion of backend with deprecated dispatch/transparent options is not supported."; + goto out; + } + + if (be->table) { + msg = "Cannot remove a backend with stick-table."; + goto out; + } + if (be->cap & PR_CAP_FE) { msg = "Cannot delete a listen section."; goto out;