From 298975b5741340d4ce9fd6bbc09898531272d53d Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 1 Nov 2023 10:21:05 +0200 Subject: [PATCH 1/2] zebra: Remove vrf_id check against VRF_DEFAULT for zebra_redistribute() A dead code. When `is_table_direct` is true, vrf_id is always VRF_DEFAULT. So this block is never called. CID 1570863. Signed-off-by: Donatas Abraitis --- zebra/redistribute.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 71e7956324b0..6121949ceddd 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -135,10 +135,6 @@ static void zebra_redistribute(struct zserv *client, int type, if (!zebra_check_addr(&rn->p)) continue; - if (type == ZEBRA_ROUTE_ADD && is_table_direct && - newre->vrf_id != VRF_DEFAULT) - continue; - zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_ADD, client, rn, newre, is_table_direct); } From 42045aac7b44d74229ba8f3e492acb404cc93320 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Wed, 1 Nov 2023 10:29:07 +0200 Subject: [PATCH 2/2] bgpd: Fix UNINTENDED_INTEGER_DIVISION for bgp_lp_event_zebra_up() CID 1570864. Signed-off-by: Donatas Abraitis --- bgpd/bgp_labelpool.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bgpd/bgp_labelpool.c b/bgpd/bgp_labelpool.c index b2bb49b94396..bf2b3566b4dd 100644 --- a/bgpd/bgp_labelpool.c +++ b/bgpd/bgp_labelpool.c @@ -652,11 +652,7 @@ void bgp_lp_event_zebra_up(void) } /* round up */ - if (((float)labels_needed / (float)lp->next_chunksize) > - (labels_needed / lp->next_chunksize)) - chunks_needed = (labels_needed / lp->next_chunksize) + 1; - else - chunks_needed = (labels_needed / lp->next_chunksize); + chunks_needed = (labels_needed + lp->next_chunksize - 1) / lp->next_chunksize; labels_needed = chunks_needed * lp->next_chunksize; /*