Skip to content

Commit

Permalink
bgpd: Fix UNINTENDED_INTEGER_DIVISION for bgp_lp_event_zebra_up()
Browse files Browse the repository at this point in the history
CID 1570864.

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Nov 2, 2023
1 parent 298975b commit 42045aa
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions bgpd/bgp_labelpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 42045aa

Please sign in to comment.