Skip to content

Commit

Permalink
bgpd: Fix per afi/safi addpath peer counting
Browse files Browse the repository at this point in the history
The total_peercount table was created as a short cut for queries about
if addpath was enabled at all on a particular afi/safi. However, the
values weren't updated, so BGP would act as if addpath wasn't enabled
when determining if updates should be sent out. The error in behavior
was much more noticeable in tx-all than best-per-as, since changes in
what is sent by best-per-as would often trigger updates even if addpath
wasn't enabled.

Signed-off-by: Mitchell Skiba <mskiba@amazon.com>
  • Loading branch information
mitch-skiba authored and ton31337 committed Nov 19, 2019
1 parent 2baa9d6 commit 5d0eedd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bgpd/bgp_addpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,15 @@ void bgp_addpath_type_changed(struct bgp *bgp)
for (type=0; type<BGP_ADDPATH_MAX; type++) {
peer_count[afi][safi][type] = 0;
}
bgp->tx_addpath.total_peercount[afi][safi] = 0;
}

for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
FOREACH_AFI_SAFI(afi, safi) {
type = peer->addpath_type[afi][safi];
if (type != BGP_ADDPATH_NONE) {
peer_count[afi][safi][type] += 1;
bgp->tx_addpath.total_peercount[afi][safi] += 1;
}
}
}
Expand Down

0 comments on commit 5d0eedd

Please sign in to comment.