Handle offlink default gateways in GNS - #41130
Merged
Ben Hillis (benhillis) merged 1 commit intoJul 23, 2026
Merged
Conversation
Copilot-Session: a404d085-142f-448f-b7fa-7ccc6528e844
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a WSLC startup failure (E_UNEXPECTED) caused by Linux rejecting a host-supplied default route when the guest interface is configured as a /32 and the provided gateway is outside that prefix (common with certain VPNs). The fix ensures host-provided default gateways are treated as on-link so the kernel accepts the route through the specified interface.
Changes:
- Mark default routes with an explicit gateway as
RTNH_F_ONLINKin the netlink route message so Linux accepts âoff-prefixâ gateways. - Add a Windows networking test case that reproduces the
/32 + offlink gatewayscenario (e.g.,100.96.5.160/32withdefault via 100.96.5.161).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/linux/netlinkutil/RoutingTable.cpp |
Extends RTNH_F_ONLINK behavior to cover host-supplied default gateways (not just link-local gateways). |
test/windows/NetworkTests.cpp |
Adds a regression test for adding a default route via an off-prefix (offlink) gateway with a /32 interface address. |
Blue (OneBlue)
approved these changes
Jul 22, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WSLC session startup can fail with
E_UNEXPECTEDwhen a VPN exposes its interface as a/32and provides a non-link-local gateway outside that prefix. Mark host-supplied default gateways as on-link so the Linux kernel accepts the route through the specified interface.Fixes #41082
Root cause
The issue trace shows the guest receiving
100.96.5.160/32followed bydefault via 100.96.5.161. The kernel rejects the default route withENETUNREACHbecause the gateway is outside the interface prefix. The earlier fix in #41003 only covered link-local gateways, while Cloudflare WARP and Tailscale use non-link-local gateways.Testing
NetworkTests::AddDefaultRouteWithOfflinkGatewayNetworkTests::RemoveAndAddDefaultRoute