-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix bad socket creation, bad socket configuration and lock within lock #23
Conversation
1abe2cf
to
d0ac48b
Compare
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.
+0.75
@@ -482,7 +482,7 @@ mod tests { | |||
fn test_wireguard_set() { | |||
let port = next_port(); | |||
let private_key = StaticSecret::random_from_rng(OsRng); | |||
let own_public_key = PublicKey::from(&private_key); | |||
let _own_public_key = PublicKey::from(&private_key); |
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.
🤔 maybe it is worth removing it this, if own_public_key
is not used?
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.
Done
boringtun/src/device/mod.rs
Outdated
let mut iter = MAX_ITR; | ||
|
||
let mut public_key = String::with_capacity(32); | ||
for byte in peer.lock().tunnel.peer_static_public().as_bytes() { | ||
let mut p = peer.lock(); |
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.
Won't this mean, that peer lock is held while receive loop is running?
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.
Fixed
b2b659d
to
8deb64b
Compare
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.
+1.0
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.
Looks good, +1
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.
+1.0
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.
+1.0
v0.6.0 introduced bugs due to which traffic became around 50 times slower. This was due to:
Bad socket configuration by Cloudflare.
Bad socket protection on our side.
A lock within a lock on our side.
So all of this is fixed with this PR.
Also added a unit test to validate connected socket creation since the other issues can be easily caught with our current nat-lab tests.
And besides that fixed some older warnings about deprecated functions and unused variables.