]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: rework bmp end of rib processing
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 16 Dec 2024 11:12:53 +0000 (12:12 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 7 Jan 2025 14:35:32 +0000 (15:35 +0100)
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>
bgpd/bgp_bmp.c

index 164f591943a371b99b7fa4b68308b306639c984a..cdaeb2527eec6fc9e1f1376044b53f1f0381d0ee 100644 (file)
@@ -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));