Skip to content

bgpd: Prevent unnecessary re-install of routes#19788

Merged
riw777 merged 1 commit intoFRRouting:masterfrom
donaldsharp:prevent_accidental_reinstall
Oct 21, 2025
Merged

bgpd: Prevent unnecessary re-install of routes#19788
riw777 merged 1 commit intoFRRouting:masterfrom
donaldsharp:prevent_accidental_reinstall

Conversation

@donaldsharp
Copy link
Member

There is this sequence of events that is happening:

a) BGP registers for a nexthop resolution for address A b)
c) Something else in the system requests for the same nexthop resolution tracking for A
d) Zebra wakes up and decides to send a update to BGP about the nexthop, even when nothing has happened. e) BGP decides that the nexthop has not changed but goes ahead and reinstalls everything again anyways.

Let's modify BGP to be a bit smarter here. It already knows that the nexthop hasn't changed, there is no need to run bgp_process on each route that is using the BNC. Let's stop this from happening.

This is only 1/2 the fix. I want to protect BGP from zebra but I also want zebra to not send the update to BGP in this case. That change is going to come in a different set of commits because it's a bit larger of a problem and will need a bit more work.

There is this sequence of events that is happening:

a) BGP registers for a nexthop resolution for address A
b) <time passes and BGP comes fully up>
c) Something else in the system requests for the same
nexthop resolution tracking for A
d) Zebra wakes up and decides to send a update to BGP
about the nexthop, even when nothing has happened.
e) BGP decides that the nexthop has not changed but goes
ahead and reinstalls everything again anyways.

Let's modify BGP to be a bit smarter here.  It already
knows that the nexthop hasn't changed, there is no need
to run bgp_process on each route that is using the BNC.
Let's stop this from happening.

This is only 1/2 the fix.  I want to protect BGP from zebra
but I also want zebra to not send the update to BGP in this case.
That change is going to come in a different set of commits because
it's a bit larger of a problem and will need a bit more work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777 riw777 merged commit 3fd2d57 into FRRouting:master Oct 21, 2025
17 checks passed
@donaldsharp donaldsharp deleted the prevent_accidental_reinstall branch December 10, 2025 13:54
@donaldsharp
Copy link
Member Author

@Mergifyio backport stable/10.4 stable/10.5

@mergify
Copy link

mergify bot commented Jan 20, 2026

backport stable/10.4 stable/10.5

✅ Backports have been created

Details

Jafaral added a commit that referenced this pull request Jan 21, 2026
bgpd: Prevent unnecessary re-install of routes (backport #19788)
ton31337 added a commit that referenced this pull request Jan 21, 2026
bgpd: Prevent unnecessary re-install of routes (backport #19788)
@mattiaswal mattiaswal mentioned this pull request Mar 18, 2026
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants