summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_bmp.c
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2024-02-27 19:35:32 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2024-10-03 16:01:12 +0200
commitddf09413d1aecd59981275bae959eabcc0046f52 (patch)
tree30122bc537530c3f0c8647c734b5cedf5a68cdfa /bgpd/bgp_bmp.c
parentMerge pull request #16992 from sri-mohan1/srib-24-frr-a (diff)
downloadfrr-ddf09413d1aecd59981275bae959eabcc0046f52.tar.xz
frr-ddf09413d1aecd59981275bae959eabcc0046f52.zip
bgpd: export labels to pre-policy bmp
Export labels to pre-policy BMP Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_bmp.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c
index 556738a60..9d99c2c7f 100644
--- a/bgpd/bgp_bmp.c
+++ b/bgpd/bgp_bmp.c
@@ -1047,7 +1047,7 @@ static void bmp_monitor(struct bmp *bmp, struct peer *peer, uint8_t flags,
static bool bmp_wrsync(struct bmp *bmp, struct pullwr *pullwr)
{
- uint8_t bpi_num_labels;
+ uint8_t bpi_num_labels, adjin_num_labels;
afi_t afi;
safi_t safi;
@@ -1241,11 +1241,12 @@ afibreak:
bpi_num_labels ? bpi->extra->labels->label : NULL,
bpi_num_labels);
- if (adjin)
- /* TODO: set label here when adjin supports labels */
- bmp_monitor(bmp, adjin->peer, 0, BMP_PEER_TYPE_GLOBAL_INSTANCE,
- bn_p, prd, adjin->attr, afi, safi, adjin->uptime,
- NULL, 0);
+ if (adjin) {
+ adjin_num_labels = adjin->labels ? adjin->labels->num_labels : 0;
+ bmp_monitor(bmp, adjin->peer, 0, BMP_PEER_TYPE_GLOBAL_INSTANCE, bn_p, prd,
+ adjin->attr, afi, safi, adjin->uptime,
+ adjin_num_labels ? &adjin->labels->label[0] : NULL, adjin_num_labels);
+ }
if (bn)
bgp_dest_unlock_node(bn);
@@ -1382,7 +1383,7 @@ static bool bmp_wrqueue(struct bmp *bmp, struct pullwr *pullwr)
struct peer *peer;
struct bgp_dest *bn = NULL;
bool written = false;
- uint8_t bpi_num_labels;
+ uint8_t bpi_num_labels, adjin_num_labels;
bqe = bmp_pull(bmp);
if (!bqe)
@@ -1453,10 +1454,11 @@ static bool bmp_wrqueue(struct bmp *bmp, struct pullwr *pullwr)
if (adjin->peer == peer)
break;
}
- /* TODO: set label here when adjin supports labels */
- bmp_monitor(bmp, peer, 0, BMP_PEER_TYPE_GLOBAL_INSTANCE,
- &bqe->p, prd, adjin ? adjin->attr : NULL, afi, safi,
- adjin ? adjin->uptime : monotime(NULL), NULL, 0);
+ adjin_num_labels = adjin && adjin->labels ? adjin->labels->num_labels : 0;
+ bmp_monitor(bmp, peer, 0, BMP_PEER_TYPE_GLOBAL_INSTANCE, &bqe->p, prd,
+ adjin ? adjin->attr : NULL, afi, safi,
+ adjin ? adjin->uptime : monotime(NULL),
+ adjin_num_labels ? &adjin->labels->label[0] : NULL, adjin_num_labels);
written = true;
}