Source routing cleanup deletes Kaido's own default routes in main #133
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: High. Found in the code review of the commits from 2026-11-04 to 2026-11-11 (
mainat6076be32). Still present onmainatadbeb2f4. Reproduced with a kernel test and in a router VM.Context
2000+).53a0d664("Let main's specific routes win for traffic from uplink addresses", 2026-11-11) added a second rule per address,from <addr> lookup main suppress_prefixlength 0. It lets LAN, VPN and static routes win for router traffic from an uplink address.reconcileDefaults, metric 1);unreachable default(installMainUnreachableRoute,internal/service/gateway_group.go:421–433).Problem
isManagedSourceRule(internal/service/gateway_kernel.go:378–386) now also counts the main-suppress rule as one of Kaido's own source rules:reconcileSourceRouting(internal/service/gateway_source_routing.go:110–118) adds the table of every managed rule to the cleanupcandidates, so main (254) becomes a candidate.gateway_source_routing.go:271–292) deletes every proto-201 default route in a candidate table that is not a desired source-table route.2000+, so the loop deletes Kaido's configured main default and the fail-closed unreachable default.Impact
default_gatewaysis set, and at least one DHCP-discovered uplink with an address has return routing on, which is the default. This is the usual setup for internet uplinks.Evidence
TestGatewayKernelAuditNoMutationsAndRepairsDrift(internal/service/gateway_route_state_kernel_test.go:15–55) expects zero kernel changes from a healthy audit in exactly this setup. On the build VM:dd77ca02it fails 4 of 4 runs withhealthy audit made 1 kernel mutationsandsource routing reconciliation failed error="no such process".c38df1d6(the parent of53a0d664) it passes 4 of 4.6076be32, Alpine kernel 6.18.63-virt, two DHCP uplinks,default_gateways = ['WAN1_GW4'], both uplinks up.ip monitor routeshowsDeleted default via 198.51.100.1 dev eth1 proto 201 metric 1followed by a re-add at 06:24:08, 06:24:38 and 06:25:08.gateway audit finished. The DHCP defaults are not touched.53a0d664was committed. The existing audit test above would have caught this.Proposed change
srcRouteTableBase…).Validation
TestGatewayKernelAuditNoMutationsAndRepairsDriftmust pass. It is a kernel test that needs conntrack labels, so it runs on the build VM, not in the sandbox.go vetoninternal/service.References
53a0d664, ADR 0027.