Page MenuHomeVyOS Platform

frr-reload: every changed line is applied twice
Open, NormalPublicBUG

Description

frr-reload's second pass re-sends every line its first pass added (lines_to_add.extend(lines_to_add_first_pass), added in 2017 (frr: 2ce26af100) so that a second one-per-context command like bgp router-id cannot cancel the first). Commands whose handlers do work are therefore applied twice per change:

  • neighbor ... maximum-prefix N: the second send clears the overflow hold-down of the sessions that just exceeded the limit and restarts them; they relearn and exceed it again;
  • bgp default local-preference, neighbor prefix-list / filter-list / distribute-list binds, bgp bestpath ...: the re-processing they trigger runs twice.

Measured at about 2.8M paths: changing default local-pref 100 -> 200 ran 12 inbound passes over the route servers (6 with the fix), the commit 307-327 s (266 s with the fix); lowering maximum-prefix on the 80-member IXP peer group dropped each session twice (160 drops; 80 with the fix). In a two-router FRR topotest the stock reload fails 5 of 8 checks.

Potential fix. The second pass sends only its own difference; a third pass re-sends only first-pass lines that the second pass removed (the router-id case), and runs only when needed. Cost: one extra read of the running configuration on commits with a real change (0.44 s at 10k lines, 1.84 s at 40k).

Details

Version
1.5.1, 1.5-rolling-202610041311
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav triaged this task as Normal priority.Oct 8 2026, 5:46 PM

@a.kudientsov Could you provide sample FRR configs (before reload and after reload)? Or vyos commands for first and second commits? Thanks.

@hedrok Smallest case I have is two plain FRR routers, no VyOS. r2 (AS 65002) announces 10 prefixes to r1 (AS 65001); r1 has no soft-reconfiguration inbound, so each inbound policy change shows up as one ROUTE-REFRESH that r1 sends. Every change on r1 is made with frr-reload.py --reload <file>. Measured on FRR 10.5.2.

r1 before:

int r1-eth0
 ip address 192.168.1.1/24
!
router bgp 65001
 no bgp ebgp-requires-policy
 no bgp network import-check
 neighbor 192.168.1.2 remote-as external
 neighbor 192.168.1.2 timers 3 10
 !
 address-family ipv4 unicast
  neighbor 192.168.1.2 route-map X in
 exit-address-family
!
ip prefix-list P seq 10 permit any
ip prefix-list Q seq 10 permit any
!
route-map X permit 10
route-map Y permit 10

r2 (... = the same pattern for .2 to .9):

int lo
 ip address 10.0.2.1/32
 ...
 ip address 10.0.2.10/32
!
int r2-eth0
 ip address 192.168.1.2/24
!
router bgp 65002
 no bgp ebgp-requires-policy
 no bgp network import-check
 neighbor 192.168.1.1 remote-as external
 neighbor 192.168.1.1 timers 3 10
 !
 address-family ipv4 unicast
  network 10.0.2.1/32
  ...
  network 10.0.2.10/32
 exit-address-family

Each "after" file is r1's base plus one change, then back to base. Count with routeRefreshSent from show bgp neighbors 192.168.1.2 json:

  1. Add bgp default local-preference 200 under router bgp 65001: 2 route refreshes sent (1 expected).
  2. Add neighbor 192.168.1.2 prefix-list P in under the address-family: 2 (1 expected).
  3. Then change it to prefix-list Q in: 3 (2 expected: the no of P and the bind of Q).
  4. Add bgp default local-preference 100, then in a second reload add neighbor 192.168.1.2 description x: the second reload sends 3 refreshes (2 expected). FRR does not print the default 100 back, so every reload sends that line again; the fix still sends it in both passes, it only drops the third send.
  5. Add neighbor 192.168.1.2 maximum-prefix 5 under the address-family (10 received): the session drops, then comes back up once within 10 s and exceeds the limit again, with MAXPFXEXCEED logged twice (expected: stays down, logged once).

Control cases with the same rig behave as expected: a route-map X in to route-map Y in swap sends 1 refresh, and two bgp router-id lines in one reload end with the second one in use.

The --debug log of the reload shows the cause: each added line appears in the pass 0 list and again in pass 1, because pass 1 extends its own list with all of pass 0's lines.

In VyOS the same happens on any commit that changes these lines, since the commit applies the rendered config through frr-reload.py --reload. I don't have a small VyOS-CLI version of this measured; the VyOS numbers in the description are from a large lab config.