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 0000000000000000000000000000000000000000..e7794325e662e76d9228b27cf92c47f51913ab3a --- /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 */