From e422b92cd270d416b4821d0ee7aafc97df644d1f Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 28 May 2026 14:01:46 +0000 Subject: [PATCH] Revert a small part of the earlier adjout_prefix_dump diff. In up_process_prefix() bring back the path_id_tx hack for regular peers. A peer not using add-path send will set the path_id_tx to 0 and so adjout_prefix_first() will return the right match. This was undone because there is a problem with this when a peer switches mode (from add-path send back to no add-path). adjout_prefix_first() returns a prefix where path_id_tx is not 0 but adjout_prefix_update() expects that to be 0. This edge case is far less common and a better workaround can be found here. Fixes the addpath intergration test. --- usr.sbin/bgpd/rde_update.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bgpd/rde_update.c b/usr.sbin/bgpd/rde_update.c index 4e3f566f317..22c2a12d471 100644 --- a/usr.sbin/bgpd/rde_update.c +++ b/usr.sbin/bgpd/rde_update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_update.c,v 1.197 2026/05/28 09:10:22 claudio Exp $ */ +/* $OpenBSD: rde_update.c,v 1.198 2026/05/28 14:01:46 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker @@ -164,6 +164,7 @@ up_process_prefix(struct rde_peer *peer, struct prefix *new, struct filterstate state; struct bgpd_addr addr; int excluded = 0; + uint32_t new_path_id_tx = 0; /* * up_test_update() needs to run before the output filters @@ -194,11 +195,13 @@ up_process_prefix(struct rde_peer *peer, struct prefix *new, } /* from here on we know this is an update */ - if (p == (void *)-1) + if (p == (void *)-1) { + new_path_id_tx = new->path_id_tx; p = adjout_prefix_get(peer, new->path_id_tx, new->pt); + } up_prep_adjout(peer, &state, new->pt->aid); - adjout_prefix_update(p, peer, &state, new->pt, new->path_id_tx, + adjout_prefix_update(p, peer, &state, new->pt, new_path_id_tx, force_update); rde_filterstate_clean(&state);