Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: never send local endpoints if disabled#12138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deansheather merged 4 commits intomainfromdean/block-endpoints
Feb 20, 2024

Conversation

deansheather
Copy link
Member

Endpoints gathered by scanning interfaces on the local computer (i.e. local addresses like192.168.1.x) would get sent to peers via Tailscale Disco protocol, even if the server or client forbade sending endpoints with the server/client flags. This prevents sending any endpoints when blocked by the user or admin.

Previously, we only blocked sending endpoints in the coordination protocol and we blocked STUN servers from functioning, but these local IPs could still get sent via Disco.

Closes#10791

Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

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

Is it possible for us to write a test for this?

@deansheather
Copy link
MemberAuthor

I can write a test but I don't think it will reliably catch issues. There's no way to force endpoints to update without calling private tailscale methods, so the only way is to sleep and make sure they never appear.

I added multiple thorough tests for the underlying(*magicsock.Conn).SetBlockEndpoints() method when I implemented it, which use hidden APIs to settle things quicker.

require.Empty(t, node.Endpoints, "conn1 got endpoints")
case node := <-nodes2:
require.Empty(t, node.Endpoints, "conn2 got endpoints")
case <-time.After(testutil.WaitShort):
Copy link
Contributor

Choose a reason for hiding this comment

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

timer gets reset each time we go around the loop, so we could wait for much longer than 10 sec.

But, I don't think we add much value by waiting for 10s. There are unit tests fortailnet.Conn blocking endpoints on node updates.

What wasn't covered prior to this is endpoints discovered via disco. The status tests you have below cover that.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oops, yeah I guess I can just remove this section then. I do still think we should wait because we can't force it to gather local endpoints, unless you know a way to test this reliably?

Copy link
Contributor

Choose a reason for hiding this comment

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

we have tests that demonstrate thattailnet.Conn won't send endpoint in a Node update callback when blockendpoints is set.

E.g.TestNodeUpdater_setBlockEndpoints_different

Where we got the endpoints from (local, STUN, etc) is immaterial.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I removed the node endpoint check but I still think the delay is required unless you know of another way to force disco endpoints to be gathered and sent immediately

@deansheatherdeansheather merged commit9861830 intomainFeb 20, 2024
@deansheatherdeansheather deleted the dean/block-endpoints branchFebruary 20, 2024 05:51
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsFeb 20, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kylecarbskylecarbskylecarbs left review comments

@spikecurtisspikecurtisspikecurtis approved these changes

Assignees

@deansheatherdeansheather

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

test flake: scaletest: Test_Runner/NoCleanup: peer is connected directly
3 participants
@deansheather@spikecurtis@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp