Skip to content

runsc/sandbox: Collect loopback routes in loopbackLink#12759

Open
copybara-service[bot] wants to merge 1 commit intomasterfrom
test/cl886250144
Open

runsc/sandbox: Collect loopback routes in loopbackLink#12759
copybara-service[bot] wants to merge 1 commit intomasterfrom
test/cl886250144

Conversation

@copybara-service
Copy link

runsc/sandbox: Collect loopback routes in loopbackLink

Update loopbackLink() to also collect routes from the loopback interface via routesForIface(), in addition to the address-derived subnet routes it already synthesizes.

Previously, only routes synthesized from addresses (e.g. 127.0.0.0/8) were included for loopback interfaces. Custom routes added to the loopback interface (e.g. via podman-network-create --route) were missed because collectLinksAndRoutes() only called routesForIface() for non-loopback interfaces.

The address-derived routes live in the kernel's local routing table, while custom routes live in the main routing table. Since routesForIface queries the main table, these two sets are distinct and both are needed.


First 3 commits of the PR are general refactoring for testability and new tests. These could go in even if the fix is deemed as out of scope for the project.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12725 from p12tic:copy-routes 80fa723

@copybara-service copybara-service bot added the exported Issue was exported automatically label Mar 19, 2026
Update loopbackLink() to also collect routes from the loopback interface via routesForIface(), in addition to the address-derived subnet routes it already synthesizes.

Previously, only routes synthesized from addresses (e.g. 127.0.0.0/8) were included for loopback interfaces. Custom routes added to the loopback interface (e.g. via podman-network-create --route) were missed because collectLinksAndRoutes() only called routesForIface() for non-loopback interfaces.

The address-derived routes live in the kernel's local routing table, while custom routes live in the main routing table. Since routesForIface queries the main table, these two sets are distinct and both are needed.

----

First 3 commits of the PR are general refactoring for testability and new tests. These could go in even if the fix is deemed as out of scope for the project.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#12725 from p12tic:copy-routes 80fa723
PiperOrigin-RevId: 886250144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant