Skip to content

Show physical uplink in network panel with TUN proxies - #13529

Open
LIghtJUNction wants to merge 1 commit into
omacom:quattrofrom
LIghtJUNction:fix/network-status-tun-uplink
Open

LIghtJUNction wants to merge 1 commit into
omacom:quattrofrom
LIghtJUNction:fix/network-status-tun-uplink

Conversation

@LIghtJUNction

Copy link
Copy Markdown

Summary

  • Select the main routing table's lowest-metric default route for network status, so TUN policy routes do not make the panel describe a virtual interface as Ethernet.
  • Keep the probe-route fallback for systems without a main-table default route.
  • Read the interface's IPv4 address when the default route does not carry prefsrc.
  • Add a route-mocked regression test for the TUN case and fallback.

The internet ping still follows the system's current route, including the TUN proxy.

Fixes #13525.

Verification

  • bash test/shell.d/network-status-route-test.sh
  • bash test/shell.d/network-test.sh
  • shellcheck -e SC2086 bin/omarchy-network-status and shellcheck -e SC1091 test/shell.d/network-status-route-test.sh
  • Live run with Clash Verge TUN: bin/omarchy-network-status --verbose reports wlan0, its Wi-Fi SSID, physical IP, and physical gateway while the proxy remains enabled.

Copilot AI lite review requested due to automatic review settings September 28, 2026 10:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 3546e7a by reading it; nothing was run on a worker, for the reason below.

This fixes the setup in #13525: with a policy-routed TUN (table 2022) and the Wi-Fi default still in main, choosing the lowest-metric main default makes the panel describe wlan0 and its gateway instead of Meta.

Four other open pull requests fix the same bug: #8866, #12071, #13666 and #13808. Of the five, #12071 is the better fix, so this one is not being taken further:

  • A tunnel whose default route is in main. uplink_route takes the lowest-metric main default whatever device it is on. A VPN that installs its default in main at a lower metric than the physical link, as NetworkManager VPN connections can,, still leaves the panel showing the tunnel as Ethernet. Show physical network behind TUN routes #12071 skips main defaults on tun and wireguard devices, and routes flagged dead, before falling back to the probe.
  • Which address is shown. When the route has no prefsrc, this takes the interface's first global IPv4 address (bin/omarchy-network-status:108), which can differ from the address the kernel actually uses on an interface with several addresses. Show physical network behind TUN routes #12071 asks the kernel for the source address toward the gateway and reports the prefix for that same address.
  • The test. Both routes in network-status-route-test.sh use lo, so it cannot show a different interface being chosen. The main-table route also carries prefsrc, so the new address fallback is never exercised, and no tunnel default is placed in main.

The others: #8866 picks the first connected NetworkManager Wi-Fi or Ethernet device regardless of routes, so a LAN-only wired link can displace the real uplink. #13666 keeps the same main selection as this one, adds a VPN kind and panel changes beyond the bug, and pings the tunnel gateway while showing the LAN one. #13808 replaces any virtual interface, bridges and bonds included, with the first main default, and swaps in the first address.

Checked by Claude Opus 5.5 reading all five diffs against quattro, and by Codex Medium, asked separately which fix was best and without being told this answer. It also picked #12071 and raised the address and test points above. Its independence is not guaranteed, since it can read this session's working files. The choice between them is the maintainer's; this pull request waits on that decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Network panel mistakes Clash TUN interface for Ethernet uplink

3 participants