Skip to content

Set a debug knob for excluding interfaces - #15957

Open
jaxxstorm wants to merge 3 commits into
mainfrom
exclude_int
Open

jaxxstorm wants to merge 3 commits into
mainfrom
exclude_int

Conversation

@jaxxstorm

Copy link
Copy Markdown
Contributor

Updates #1552

Signed-off-by: Lee Briggs [email protected]

@ghost

ghost commented May 13, 2025 •

Copy link
Copy Markdown

Pull Request Revisions

RevisionDescription
r3
Renamed suppressInterfaces to excludeInterfacesRefactored variable name from suppressInterfaces to excludeInterfaces while maintaining existing comment description
r2
Renamed debug interface exclusion variableRenamed excludedInterfaces to excludeInterfaces and updated associated comment for clarity
r1
Added interface exclusion debug featureIntroduced new debug knob and function to exclude specific network interfaces from Tailscale traffic processing

✅ AI review completed for r3
Help React with emojis to give feedback on AI-generated reviews:
  • 👍 means the feedback was helpful and actionable
  • 👎 means the feedback was incorrect or unhelpful
💬 Replying to feedback with a comment helps us improve the system. Your input also contributes to shaping future interactions with the AI reviewer.

We'd love to hear from you—reach out anytime at [email protected].

Comment thread net/netmon/state.go Resolved
Comment thread net/netmon/state.go Resolved
Comment thread net/netmon/state.go Resolved
@jaxxstorm

Copy link
Copy Markdown
Contributor Author

Forgive me @bradfitz I'm trying to see if I can help a customer with my awful code

@jaxxstorm
jaxxstorm requested a review from bradfitz May 13, 2025 03:44
@raggi

raggi commented May 15, 2025

Copy link
Copy Markdown
Member

I think we should do craciunoiuc@599e84f at the same time.

@istathar

Copy link
Copy Markdown

Can we make it so it's not a _DEBUG_ thing and actually a setting that people can use?

@jaxxstorm jaxxstorm closed this May 27, 2025
@jaxxstorm jaxxstorm reopened this May 27, 2025
Comment thread net/netmon/state.go Outdated
Comment on lines +30 to +32
// suppressInterfaces is a debug knob containing a list of interface names that should not be advertised as endpoints.
// Traffic may still flow over these interfaces if system routing makes the decision to do so.
var excludeInterfaces = envknob.RegisterString("TS_DEBUG_EXCLUDE_INTERFACES")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's a mismatch between the comment on line 30 which mentions 'suppressInterfaces' and the variable name 'excludeInterfaces' on line 32. Ensure comment and variable names are consistent.

Comment thread net/netmon/state.go
Comment on lines +53 to +67
func isExcludedInterface(nif *net.Interface) bool {
if nif == nil {
return false
}

remain := excludeInterfaces()
for remain != "" {
var candidate string
candidate, remain, _ = strings.Cut(remain, ",")
if strings.TrimSpace(candidate) == nif.Name {
return true
}
}
return false
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Consider adding a test for the isExcludedInterface function to ensure it correctly parses interface names from the environment variable.

Signed-off-by: Lee Briggs <[email protected]>
@jaxxstorm
jaxxstorm requested a review from raggi May 27, 2025 16:20
@istathar

Copy link
Copy Markdown

The other thing to look into with this is that the use case we ran into is (I can get you the support ticket number if you want more details) on Macs where unlike Linux + NetworkManager the Mac Tailscale client would bind to the existing wifi or wired connection instead of using whatever the default route is (an OpenVPN tunnel, in this case). We need Mac users to be able to explicitly say "Tailscale, use utun0 only please".

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.

3 participants