Package: bird3 Version: 3.1.8-0+deb13u1 Severity: important Tags: upstream fixed-upstream patch
Hi, We run BIRD on Debian trixie in our network (AS214507). While testing changes to our routing policy, we noticed that BIRD sometimes selects and exports a new route without installing it in the Linux routing table. The kernel either has no route or retains the previous next hop until the next kernel scan. There is no error in the BIRD log. This turned out to be the route-ID reuse bug already fixed upstream: https://gitlab.nic.cz/labs/bird/-/commit/61be5cde6fd231046a2b4daf82fdbf4715af1aa1 I've attached a small reproducer using network namespaces and two static routes. It can be run as root in a disposable VM or container with bird3 and iproute2: bash repro-kernel-sync.sh 4 100 bash repro-kernel-sync.sh 6 100 With the current trixie package, 41 out of 100 switches failed for each address family. With just the upstream patch applied to the Debian source package, both runs completed without a failure. The route was checked one second after each switch. In a separate test, missing routes took almost 60 seconds to appear in the kernel. We also saw stale next hops and missing blackhole routes in a larger routing lab. This is particularly awkward to diagnose because the BGP sessions and BIRD routing table look fine. The fix is included in BIRD 3.1.10 and applies cleanly to the current trixie source package. I've attached the patch and test results. The tests were run on amd64, using trixie containers (host kernel 7.3.4) and Debian 13 VMs (6.12.113+deb13-cloud-amd64). Could we get this fix into trixie? We'd be happy to test a candidate package. Best regards, AS214507 / SIA Pūces datorsistēmas (PLDS)
Description: Kernel: Fix route update when recycling route IDs Mistakenly the seen_map was checked on regular update, causing an update to be ignored if a route was withdrawn and its ID recycled too fast. Author: Maria Matejka <[email protected]> Origin: upstream, https://gitlab.nic.cz/labs/bird/-/commit/61be5cde6fd231046a2b4daf82fdbf4715af1aa1 Comment: 3.1.x backport of thread-next 924f3312b62dc9d3a97d53ebb7d83b36ef0eee96 (same change; 3.4.x: ca73353a714a45d752a6f74f3d92b92ae9b3bd9f). Applied-Upstream: v3.1.10, https://gitlab.nic.cz/labs/bird/-/commit/61be5cde6fd231046a2b4daf82fdbf4715af1aa1 Forwarded: not-needed Last-Update: 2026-12-01 --- sysdep/unix/krt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index ba6b750a..21a121f3 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -735,7 +735,6 @@ krt_rt_notify(struct proto *P, struct channel *ch, const net_addr *net, case KPS_LEARNING: bug("%s: Graceful recovery in progress but received route notification.", P->name); - case KPS_IDLE: case KPS_PRUNING: if (new && bmap_test(&p->seen_map, new->id)) { @@ -749,6 +748,7 @@ krt_rt_notify(struct proto *P, struct channel *ch, const net_addr *net, } /* fall through */ + case KPS_IDLE: case KPS_FIRST_SCAN: case KPS_SCANNING: /* Actually replace the route */
# bird3 kernel sync after route-ID reuse: test results
AS214507, 1 December 2026. Tests were run in isolated containers and GNS3 VMs.
Packages:
| Label | Package | Contents |
|---|---|---|
| Debian 3.1.8 | `bird3 3.1.8-0+deb13u1` (trixie) | as shipped |
| +kernel fix | `3.1.8-0+deb13u1+lab1k` (lab build) | Debian source + upstream `61be5cde` only |
| +both fixes | `3.1.8-0+deb13u1+lab1` (lab build) | Debian source + `61be5cde` + `decbcf49` (configure abort, separate report) |
| upstream builds | built from the upstream git tags/branches | see table 2 |
Lab packages: `apt-get source bird3=3.1.8-0+deb13u1`, patches added to `debian/patches/series`
(after Debian's `adapt_version_script`), `dch`, `dpkg-buildpackage -b` in a clean `debian:trixie`
container. The kernel patch applies without offset or fuzz. Build-time unit tests: 29 OK, 0 FAIL.
## 1. Reproducer (`reproducer/repro-kernel-sync.sh`, plain network namespace)
100 switches of the default route between two static protocols (next hop A -> B), kernel checked
1 s after each switch. Kernel protocol `scan time` default (60 s).
| Package | IPv4 | IPv6 |
|---|---|---|
| Debian 3.1.8 | **41/100** | **41/100** |
| +kernel fix (`61be5cde` only) | **0/100** | **0/100** |
Failures come in contiguous blocks of iterations (the windows that follow a kernel scan which saw
the previous route), e.g. iterations 30-... in the IPv4 run. Logs: `reproducer/results/`.
## 2. Earlier harness (same mechanism, route in a VRF table, Debian trixie containers)
`repro/bird_kernel_default_gap_v{4,6}.sh 100` (VRF `table 1000` with an `unreachable` fallback).
| Build | IPv4 | IPv6 | Date |
|---|---|---|---|
| Debian 3.1.8 package | 20/100 | 20/100 | 2026-11-30, repeated 2026-12-01 |
| upstream v3.1.8 / v3.1.9 / v3.4.0 | 20/100 each | 20/100 each | 2026-11-30 |
| upstream v3.1.8 + `61be5cde` | 0/100 | 0/100 | 2026-11-30 |
| upstream v3.4.0 + `ca73353a7` | 0/100 | 0/100 | 2026-11-30 |
| upstream mq-stable-v3.4: as is / with only `ca73353a7` reverted | 0/100 / 20/100 | 0/100 / 20/100 | 2026-11-30 |
| Debian +kernel fix (`lab1k`) | **0/100** | **0/100** | 2026-12-01 |
| Debian +both fixes (`lab1`) | 0/100 | 0/100 | 2026-12-01 |
The revert test on mq-stable-v3.4 shows the fix is causal, not a timing change.
## 3. Duration and traffic effect (upstream v3.1.8 vs. fixed builds, 200 switches, ping every 10 ms)
| Build | Holes >= 1 s (IPv4 / IPv6) | Hole length | Ping loss over the run |
|---|---|---|---|
| v3.1.8 | 3 / 3 | 59.6-59.9 s each | 47 % (v4), 47 % (v6) |
| v3.4.0 | 2 / 3 | 59.9 s and 3.4 s (stale next hop, see below) | 23 % / 47 % |
| fixed builds | 0 / 0 | - | 0.1-0.2 % (one packet per ~10 switches, the del->add moment) |
netlink trace (strace + `ip -ts monitor`) of a failed switch on 3.1.8: `RTM_DELROUTE` of the old
route is sent and acknowledged; BIRD logs the new route as exported (`k4.ipv4 < added 0.0.0.0/0 ... id 1`)
but no `RTM_NEWROUTE` is sent; the kernel has no default until the next scan ~59 s later, when a
`RTM_NEWROUTE NLM_F_REPLACE` restores it. No error is logged; `birdc show route` shows the route.
## 4. Scenario coverage (upstream v3.1.8 vs. v3.1.8 + fix, 50k other routes, scan 60 s)
| Scenario | v3.1.8 | + fix |
|---|---|---|
| Switch to a backup already present in the RIB | 0/75 | 0 |
| Preferred route returns (new rte replaces the backup) | 46/75: kernel keeps the **old next hop** ~59 s | 0/100 |
| Withdraw one prefix, announce a different prefix | 3/200: new prefix missing ~60 s | 0/200 |
| BGP session restart every 20 s | 3/15: route back after 56-60 s instead of ~4.3 s | 0/15 |
So the effect is not limited to default routes or to the switching prefix: whichever new route
receives a recycled ID within the window can be skipped.
## 5. Observations in a larger BIRD lab (IX paths, RTBH)
Podman lab with 7 BIRD 3.x instances (two route reflectors, an RR client, edge/IX nodes, a spoke,
an emulator of route servers and bilateral peers), real configuration templates. The suite waits
for RIB/FIB agreement at each step and reports how long the kernel lagged.
| Build | Runs | Lag events | Lag |
|---|---|---|---|
| Debian 3.1.8 | 5 | 2, 2, 2, 6, 8 | 3-40 s per event |
| +both fixes (`lab1`) | 1 | 0 | - |
| upstream 3.1.10 | 1 | 0 | - |
Affected steps included the return of IX paths after a route-server/bilateral outage (stale next
hop up to 40 s) and RTBH host routes re-learned after an edge restart (blackhole route missing from
the kernel table for 11-40 s, so traffic to the target was not discarded during that time).
Limitation: this suite was not run with the kernel-only package; the fixed results are from the
combined backport and from 3.1.10.
## 6. Limitations
- The defect needs a new route to receive a route ID that was freed after the last kernel scan.
Switching to a route already present in the RIB was not affected (table 4). Not every route change
is affected and not every configuration will see it.
- Reproduction rates depend on timing relative to the scan; 20/100 and 41/100 come from two
harnesses with different cadence, both 0/100 with the fix.
- Containers ran on a non-Debian host kernel (Linux 7.3.4); the kernel acknowledges every request
BIRD sends, the missing request is on the BIRD side (strace).
- A residual window may exist in `KPS_PRUNING` (refeed right after a scan), not observed in tests.
repro-kernel-sync.sh
Description: Bourne shell script

