Skip to content

netmon: add per-interface metric field - #414

Merged
npry merged 1 commit into
mainfrom
npry/netmon.interface-metric
Sep 16, 2026
Merged

npry merged 1 commit into
mainfrom
npry/netmon.interface-metric

Conversation

@npry

@npry npry commented Sep 16, 2026

Copy link
Copy Markdown
Member

This is a follow-on to #396 which is technically required for it to function properly (but kind of in an edge case: only if you have more than one default route on your machine). I'm splitting it out to a stacked PR to avoid re-requesting the same review on the same PR again and because this is mostly logically standalone.

Context: #396 (comment)

This implements what was discussed there^: netmon routes and interfaces now both have a metric field, and the netmon implementation fills whatever is appropriate on its platform. Then it's the responsibility of the pieces that consume updates from netmon to add those fields together to get the true route metric. Currently that's just used by the default route metric tracker, which needed some refactoring to handle this.

@npry
npry added this pull request to stack #397 September 16, 2026 17:13
@npry
npry force-pushed the npry/netmon.interface-metric branch 3 times, most recently from 4e47d44 to d9a4b09 Compare September 16, 2026 17:19

@dylan-tailscale dylan-tailscale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, one docstring suggestion

Comment thread ts_netmon/src/netmon.rs Outdated
Signed-off-by: Nathan Perry <nathan@tailscale.com>
Change-Id: I00d92d7d0dd5c5ad5ac2f8e19692b0fb6a6a6964
@npry
npry force-pushed the npry/netmon.interface-metric branch from d9a4b09 to 24144a5 Compare September 16, 2026 21:28
Base automatically changed from npry/netmon.mac to main September 16, 2026 21:45
@npry
npry merged commit 24144a5 into main Sep 16, 2026
23 of 45 checks passed
@npry
npry deleted the npry/netmon.interface-metric branch September 16, 2026 21:45
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.

2 participants