-
Notifications
You must be signed in to change notification settings - Fork 4
fix: stop selecting direct connections with too-small MTU #85
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -77,8 +77,8 @@ func TestMarshalAndParse(t *testing.T) { | |||
} | |||
|
|||
gotHex := fmt.Sprintf("% x", got) | |||
if gotHex != tt.want { | |||
t.Fatalf("wrong marshal\n got: %s\nwant: %s\n", gotHex, tt.want) | |||
if !strings.HasPrefix(gotHex, tt.want) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we expect the end of the ping payload to be a bunch of 00s we should probably test that, either by changing the want
for each of the ping/pong cases to be the full value or by some other method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't care that it's zeros per se, but I'll add a check that it's the padded length.
Merge activity
|
Fixes #15523 Uses latest https://github.com/coder/tailscale which includes coder/tailscale#85 to stop selecting paths with small MTU for direct connections. Also updates the tailnet integration test to reproduce the issue. The previous version had the 2 peers connected by a single veth, but this allows the OS to fragment the packet. In the new version, the 2 peers (and server) are all connected by a central router. The link between peer 1 and the router has an adjustable MTU. IPv6 does not allow packets to be fragmented by intermediate routers, so sending a too-large packet in this scenario forces the router to drop packets and reproduce the issue (without the tailscale changes).
related to: coder/coder#15523
This PR:
The end result is that Disco Ping and Pong packets are not directly exchanged over paths with too-small MTU, and thus, those endpoints are not chosen for direct connections. (Alternate direct paths with bigger MTU may be chosen, or we may fall back to DERP.)