Skip to content

bgpd: replay routes for every BGP instance to zebra - #23272

Open
0n41rd4 wants to merge 2 commits into
FRRouting:masterfrom
0n41rd4:bgp-zebra-vrf
Open

bgpd: replay routes for every BGP instance to zebra#23272
0n41rd4 wants to merge 2 commits into
FRRouting:masterfrom
0n41rd4:bgp-zebra-vrf

Conversation

@0n41rd4

@0n41rd4 0n41rd4 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

When zebra restarts while bgpd keeps running, routes owned by a tenant
VRF BGP instance stay in the BGP RIB but are missing from zebra and the
kernel FIB. The reconnect replay from #22362 covers the default instance.

Closes: #23271

@frrbot frrbot Bot added bgp tests Topotests, make check, etc labels Sep 6, 2026
@greptile-apps

greptile-apps Bot commented Sep 6, 2026

Copy link
Copy Markdown

Greptile Summary

The PR restores tenant-VRF BGP routes after zebra reconnects by registering every BGP instance already known to zebra and replaying each instance’s selected FIB-eligible routes.

  • Preserves default-instance graceful-restart capability handling.
  • Adds a tenant-VRF topotest covering route restoration after zebra-only restart.
  • Consolidates the test topology’s daemon configuration into integrated FRR configuration files.
  • Saves and restores the host udp_l3mdev_accept setting modified by the test.

Confidence Score: 5/5

The PR appears safe to merge, with no outstanding correctness or repository-rule violations identified.

The reconnect path now iterates only over BGP instances already known to zebra, re-registers each one, and replays its FIB-eligible tables; the tenant-VRF test directly checks route restoration after zebra restarts. The previous host-sysctl finding was manually resolved and the current teardown restores the saved value.

Important Files Changed

Filename Overview
bgpd/bgp_zebra.c Expands zebra reconnect registration and route replay from the default BGP instance to every zebra-known BGP instance.
tests/topotests/zebra_reconnect_route_replay/test_zebra_reconnect_route_replay_vrf.py Adds tenant-VRF replay coverage and restores the host sysctl during teardown.
tests/topotests/zebra_reconnect_route_replay/vr1/frr.conf Defines the originating router’s integrated tenant-VRF configuration for OSPF, RIP, IS-IS, and BGP.
tests/topotests/zebra_reconnect_route_replay/vr2/frr.conf Defines the receiving router’s integrated tenant-VRF configuration used to verify route replay.

Sequence Diagram

sequenceDiagram
    participant B as bgpd
    participant Z as zebra
    participant K as Kernel FIB

    Z->>B: Reconnect
    B->>Z: Register BFD client
    loop Every BGP instance known to zebra
        B->>Z: Register BGP instance
        loop Every FIB-eligible AFI/SAFI
            B->>Z: Replay selected routes
            Z->>K: Reinstall routes
        end
    end
Loading

Reviews (2): Last reviewed commit: "tests: add VRF variant of zebra reconnec..." | Re-trigger Greptile

@ton31337-hostinger ton31337-hostinger left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please convert topotest using frr.conf (instead of per-daemon files)..

Comment thread tests/topotests/zebra_reconnect_route_replay/vr1/frr.conf Outdated
@0n41rd4

0n41rd4 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@greptile review

@0n41rd4

0n41rd4 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

ci:rerun

@0n41rd4

0n41rd4 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Hi @ton31337 , i pushed the changes

bgp_zebra_connected() replays the selected routes only for the default
BGP instance, so routes owned by tenant VRF instances stay in the BGP RIB
but are missing from zebra. Replay via bgp_zebra_announce_table() for
every BGP instance known to zebra.

Signed-off-by: Adriano Cordova <adrianox@gmail.com>
Run ospfd, ripd, isisd and bgpd inside a tenant VRF and verify each
daemon replays its VRF-instance routes after a zebra restart.

Signed-off-by: Adriano Cordova <adrianox@gmail.com>
@0n41rd4

0n41rd4 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

ci:rerun

@0n41rd4

0n41rd4 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

changed router-ids to documentation range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bgp master size/L tests Topotests, make check, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bgpd: BGP routes owned by VRF instances not replayed to zebra after a zebra restart

3 participants