From 72b8ec6a93885c943d8303303e268bd5ec286a46 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 28 Aug 2013 15:00:24 +0200 Subject: 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. --- src/fastd.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/fastd.c') 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; -- cgit v1.2.3