Skip to content

Fixes to route mirroring#40099

Merged
FetoiuCatalin merged 12 commits intomasterfrom
user/cfetoiu/vpn_route_fixes
Apr 13, 2026
Merged

Fixes to route mirroring#40099
FetoiuCatalin merged 12 commits intomasterfrom
user/cfetoiu/vpn_route_fixes

Conversation

@FetoiuCatalin
Copy link
Copy Markdown
Contributor

@FetoiuCatalin FetoiuCatalin commented Apr 3, 2026

Summary of the Pull Request

Testing mirrored mode with Proton VPN exposed some issues with route mirroring:

  1. Adding routes using netlink messages did not account for default onlink routes (destination everything, no next hop), leading to default onlink routes for IPv6 to fail to be added. Proton VPN uses such a route on the host, which failed to be mirrored and the IPv6 traffic was not going over the VPN as expected
  2. When mirroring routes from windows, the metric used in Linux is determined by adding windows interface metric and route metric. It's possible those are both 0 (high priority), leading to a Linux metric with route 0, but 0 is treated as unspecified and defaulted to 1024 instead. Fix this to change the metric 0 to 1 (which is highest priority metric in Linux)

Validation Steps Performed

Testing with ProtonVPN and confirming v6 traffic is correctly routed over the mirrored interface that corresponds to the VPN
Running all NetworkTests
Added new tests that verify adding default onlink routes works as expected for both IPv4 and IPv6

Copilot AI review requested due to automatic review settings April 3, 2026 18:59
@FetoiuCatalin FetoiuCatalin marked this pull request as ready for review April 3, 2026 19:04
@FetoiuCatalin FetoiuCatalin requested a review from a team as a code owner April 3, 2026 19:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses gaps in WSL mirrored networking route mirroring, specifically improving handling of default on-link routes (no next hop) and adjusting mirrored route metrics to better match Linux behavior.

Changes:

  • Add a Windows NetworkTests coverage case for adding default on-link routes in both IPv4 and IPv6.
  • Update mirrored route metric mapping to avoid emitting metric 0.
  • Extend Linux netlink route programming to support default on-link routes by sending a default route without RTA_GATEWAY.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
test/windows/NetworkTests.cpp Adds a new test validating default on-link routes for IPv4/IPv6.
src/windows/service/exe/WslMirroredNetworking.cpp Adjusts route metric handling to remap metric 0 to 1.
src/linux/netlinkutil/RoutingTable.h Declares a new helper for default on-link route netlink messages.
src/linux/netlinkutil/RoutingTable.cpp Implements default on-link default-route netlink messaging and updates default-route logging.

keith-horton
keith-horton previously approved these changes Apr 3, 2026
Copy link
Copy Markdown
Member

@keith-horton keith-horton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

@FetoiuCatalin FetoiuCatalin force-pushed the user/cfetoiu/vpn_route_fixes branch from f8b1912 to ea607a8 Compare April 6, 2026 18:04
Copilot AI review requested due to automatic review settings April 6, 2026 18:28
@FetoiuCatalin FetoiuCatalin force-pushed the user/cfetoiu/vpn_route_fixes branch from ea607a8 to 9c60a6d Compare April 6, 2026 18:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings April 8, 2026 18:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings April 9, 2026 20:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

keith-horton
keith-horton previously approved these changes Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 20:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

keith-horton
keith-horton previously approved these changes Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 22:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@FetoiuCatalin
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@FetoiuCatalin FetoiuCatalin merged commit 722fb02 into master Apr 13, 2026
13 checks passed
@FetoiuCatalin FetoiuCatalin deleted the user/cfetoiu/vpn_route_fixes branch April 13, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants