-
Notifications
You must be signed in to change notification settings - Fork 5
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
Changes from 2 commits
bede4fb
1bab46f
ef3f81d
c89c6b7
4686156
6923084
b824a9c
4ec7ef5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
|
|
||
| import ( | ||
| "fmt" | ||
| "golang.org/x/crypto/nacl/box" | ||
| "net/netip" | ||
| "reflect" | ||
| "strings" | ||
|
|
@@ -75,6 +76,11 @@ | |
| if !ok { | ||
| t.Fatalf("didn't start with foo: got %q", got) | ||
| } | ||
| // CODER: 1310 is max size of a Wireguard packet we will send. | ||
| expectedLen := 1310 - len(Magic) - keyLen - NonceLen - box.Overhead | ||
| if _, ok := tt.m.(*CallMeMaybe); !ok && len(got) != expectedLen { | ||
spikecurtis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| t.Fatalf("Ping/Pong not padded: got len %d, want len %d", len(got), expectedLen) | ||
| } | ||
|
|
||
| gotHex := fmt.Sprintf("% x", got) | ||
| if !strings.HasPrefix(gotHex, tt.want) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.