diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-16 12:12:53 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2025-01-07 15:35:32 +0100 |
commit | d34fe66a5d346d47b4d9bd02d085fb2856ef1d54 (patch) | |
tree | 42545e45e8091436791c5b066292797e7c92e506 /bgpd | |
parent | bgpd: fix access to invalid memory zone (diff) | |
download | frr-d34fe66a5d346d47b4d9bd02d085fb2856ef1d54.tar.xz frr-d34fe66a5d346d47b4d9bd02d085fb2856ef1d54.zip |
bgpd: rework bmp end of rib processing
Move the end of rib processing code of a given BGP instance in a
separate function. This code prepares the next commit, it avoids
having the following warning:
> WARNING: Too many leading tabs - consider code refactoring
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_bmp.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 164f59194..cdaeb2527 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -1240,6 +1240,19 @@ static void bmp_monitor(struct bmp *bmp, struct peer *peer, uint8_t flags, stream_free(msg); } +static void bmp_eor_afi_safi(struct bmp *bmp, afi_t afi, safi_t safi, uint8_t peer_type_flag) +{ + zlog_info("bmp[%s] %s %s table completed (EoR)", bmp->remote, afi2str(afi), safi2str(safi)); + + bmp_eor(bmp, afi, safi, BMP_PEER_FLAG_L, peer_type_flag); + bmp_eor(bmp, afi, safi, 0, peer_type_flag); + bmp_eor(bmp, afi, safi, 0, BMP_PEER_TYPE_LOC_RIB_INSTANCE); + + bmp->afistate[afi][safi] = BMP_AFI_LIVE; + bmp->syncafi = AFI_MAX; + bmp->syncsafi = SAFI_MAX; +} + static bool bmp_wrsync(struct bmp *bmp, struct pullwr *pullwr) { uint8_t bpi_num_labels, adjin_num_labels; @@ -1340,19 +1353,9 @@ afibreak: return true; } eor: - zlog_info("bmp[%s] %s %s table completed (EoR)", - bmp->remote, afi2str(afi), - safi2str(safi)); - - bmp_eor(bmp, afi, safi, BMP_PEER_FLAG_L, peer_type_flag); - bmp_eor(bmp, afi, safi, 0, peer_type_flag); - bmp_eor(bmp, afi, safi, 0, - BMP_PEER_TYPE_LOC_RIB_INSTANCE); - - bmp->afistate[afi][safi] = BMP_AFI_LIVE; - bmp->syncafi = AFI_MAX; - bmp->syncsafi = SAFI_MAX; - return true; + bmp_eor_afi_safi(bmp, afi, safi, + peer_type_flag); + return true; } bmp->syncpeerid = 0; prefix_copy(&bmp->syncpos, bgp_dest_get_prefix(bn)); |