Skip to content
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

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

ThrasherLT
Copy link

@ThrasherLT ThrasherLT commented Jul 16, 2024

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.

@ThrasherLT ThrasherLT force-pushed the LLT-5351_v060_slowdowns branch 2 times, most recently from 1abe2cf to d0ac48b Compare July 16, 2024 12:20
@ThrasherLT ThrasherLT marked this pull request as ready for review July 16, 2024 12:20
Copy link

@mathiaspeters mathiaspeters left a 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);
Copy link

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?

Copy link
Author

Choose a reason for hiding this comment

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

Done

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();
Copy link

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?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed

@ThrasherLT ThrasherLT force-pushed the LLT-5351_v060_slowdowns branch from b2b659d to 8deb64b Compare July 17, 2024 07:25
Copy link

@Jauler Jauler left a comment

Choose a reason for hiding this comment

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

+1.0

Copy link

@stalowyjez stalowyjez left a comment

Choose a reason for hiding this comment

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

Looks good, +1

Copy link

@tomasz-grz tomasz-grz left a comment

Choose a reason for hiding this comment

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

+1.0

Copy link
Collaborator

@packgron packgron left a comment

Choose a reason for hiding this comment

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

+1.0

@ThrasherLT ThrasherLT merged commit 717a882 into libtelio-master-v0.6.0 Jul 17, 2024
24 checks passed
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.

6 participants