summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-28 15:00:24 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-28 15:45:43 +0200
commit72b8ec6a93885c943d8303303e268bd5ec286a46 (patch)
tree426fbb37dba45838ff0022a4fedeff224295608a /src/fastd.c
parent1b9709bae3718efc397fc824fb8a0ec5fac31bd1 (diff)
downloadfastd-72b8ec6a93885c943d8303303e268bd5ec286a46.tar
fastd-72b8ec6a93885c943d8303303e268bd5ec286a46.zip
ec25519: ensure that there is always a handshake enqueued after sending a handshake finish
This ensures that the handshake is repeated in case the finish packet is lost.
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/fastd.c b/src/fastd.c
index 65fc59f..173e5f3 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -393,10 +393,6 @@ static inline void update_time(fastd_context_t *ctx) {
clock_gettime(CLOCK_MONOTONIC, &ctx->now);
}
-static inline void schedule_handshake(fastd_context_t *ctx, fastd_peer_t *peer) {
- fastd_task_schedule_handshake(ctx, peer, fastd_rand(ctx, 17500, 22500));
-}
-
static void send_handshake(fastd_context_t *ctx, fastd_peer_t *peer) {
if (!fastd_peer_is_established(peer)) {
if (!peer->next_remote)
@@ -431,7 +427,7 @@ static void handle_tasks(fastd_context_t *ctx) {
while ((task = fastd_task_get(ctx)) != NULL) {
switch (task->type) {
case TASK_HANDSHAKE:
- schedule_handshake(ctx, task->peer);
+ fastd_peer_schedule_handshake(ctx, task->peer);
if(!fastd_peer_may_connect(ctx, task->peer)) {
task->peer->next_remote = task->peer->remotes;