Commit e5e1a3a749 for frr

commit e5e1a3a7499ee0963e36b9c5578b40b2f525e74f
Author: Yukie Kawamata <y-kawamata@sakura.ad.jp>
Date:   Wed Nov 11 22:49:58 2026 +0900

    bgpd: Inherit addpath-tx-best-selected count for dynamic peers

    peer_group2peer_config_copy_af() copies addpath_type from the peer-group
    configuration to a peer, but it does not copy addpath_best_selected.  As a
    result, dynamic peers created through 'bgp listen range' into a peer-group
    with 'addpath-tx-best-selected N' only advertise the single best path.

    Copy addpath_best_selected alongside addpath_type so that the configured
    number of best selected paths is honored for dynamic peers too.

    Fixes: #24318
    Signed-off-by: Yukie Kawamata <y-kawamata@sakura.ad.jp>

diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 417bbc3ff4..1256cd1460 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2810,6 +2810,7 @@ static void peer_group2peer_config_copy_af(struct peer_group *group,

 	if (peer->addpath_type[afi][safi] == BGP_ADDPATH_NONE) {
 		peer->addpath_type[afi][safi] = conf->addpath_type[afi][safi];
+		peer->addpath_best_selected[afi][safi] = conf->addpath_best_selected[afi][safi];
 		bgp_addpath_type_changed(conf->bgp);
 	}
 }