Commit 6fcf96d1 authored by Nico's avatar Nico
Browse files

add patch to remove fastd delay

parent 252b25c6
From d2a2110bdf84ef5c9bac054e92948c2ea39de3ab Mon Sep 17 00:00:00 2001
From: Nico <github@nicoboehr.de>
Date: Mon, 26 Apr 2021 14:16:03 +0000
Subject: [PATCH] add patch to remove fastd random delay on inital handshake
---
...ove-random-delay-on-inital-handshake.patch | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 patches/packages/packages/0002-fastd-remove-random-delay-on-inital-handshake.patch
diff --git a/patches/packages/packages/0002-fastd-remove-random-delay-on-inital-handshake.patch b/patches/packages/packages/0002-fastd-remove-random-delay-on-inital-handshake.patch
new file mode 100644
index 00000000..e7794325
--- /dev/null
+++ b/patches/packages/packages/0002-fastd-remove-random-delay-on-inital-handshake.patch
@@ -0,0 +1,37 @@
+From: Nico <github@nicoboehr.de>
+Date: Mon, 26 Apr 2021 14:12:43 +0000
+Subject: fastd: remove random delay on inital handshake
+
+When a peer limit is defined, fastd will by default randomly delay
+the inital handshake. As our gateways delay their handshake to
+better distribute their load, this is undesireable.
+
+diff --git a/net/fastd/patches/0100-remove-random-delay-on-inital-handshake.patch b/net/fastd/patches/0100-remove-random-delay-on-inital-handshake.patch
+new file mode 100644
+index 0000000000000000000000000000000000000000..40ca26812bda65d8b08a1034e23d1b2335c77259
+--- /dev/null
++++ b/net/fastd/patches/0100-remove-random-delay-on-inital-handshake.patch
+@@ -0,0 +1,23 @@
++--- a/src/peer.c
+++++ b/src/peer.c
++@@ -322,19 +322,11 @@ static void reset_peer(fastd_peer_t *pee
++
++ /**
++ Starts the first handshake with a newly setup peer
++-
++- If a peer group has a peer limit the handshakes will be delayed between 0 and 3 seconds
++- make the choice of peers random (it will be biased by the latency, which might or might not be
++- what a user wants)
++ */
++ static void init_handshake(fastd_peer_t *peer) {
++- unsigned delay = 0;
++- if (has_group_config_constraints(peer->group))
++- delay = fastd_rand(0, 3000);
++-
++ peer->state = STATE_HANDSHAKE;
++
++- fastd_peer_schedule_handshake(peer, delay);
+++ fastd_peer_schedule_handshake(peer, 0);
++ }
++
++ /** Handles an asynchronous DNS resolve response */
--
2.30.2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment