From 4e9ff0e608ab4a3c21cbe59d2e3e667bdd96e0e2 Mon Sep 17 00:00:00 2001 From: Frederic Lecaille Date: Fri, 23 Oct 2026 18:18:36 +0200 Subject: [PATCH] BUG/MINOR: peers: forget the remote table when ignoring an unknown key type Commit 1696cfaa1 ("BUG/MEDIUM: peers: enforce check on incoming table key type") makes peer_treat_definemsg() ignore a table definition with an unknown key type. But contrary to all other paths ignoring a definition, it leaves p->remote_table set to the local table matched by name. The update messages which follow are thus not ignored but decoded using the local table's key type and applied to it, while they were built for a different key type. This is precisely the situation the commit wanted to cover (a newer peer supporting new key types). Let's reset p->remote_table as the other paths do. HAProxy never emits such a value: peer_net_key_type[] only covers the five supported key types, so a compliant peer stays below PEER_KT_TYPES. This is therefore latent today, and becomes reachable the day a new key type is added, when a newer peer talks to an older one in a mixed-version cluster. This must be backported to all stable versions. --- src/peers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/peers.c b/src/peers.c index 4fffcf352..64fdfdd9c 100644 --- a/src/peers.c +++ b/src/peers.c @@ -2412,6 +2412,7 @@ static inline int peer_treat_definemsg(struct appctx *appctx, struct peer *p, } if (table_type < 0 || table_type >= PEER_KT_TYPES) { + p->remote_table = NULL; TRACE_PROTO("ignore table definition message: unknown table type", PEERS_EV_SESS_IO|PEERS_EV_RX_MSG|PEERS_EV_PROTO_DEF, appctx, p); goto ignore_msg; } -- 2.47.3