From 80b1412c65a7a7e209c66684cf78e2ab13cfd5e6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 8 Sep 2014 20:30:44 +0200 Subject: Make stats of reordered packets --- src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/protocols/ec25519_fhmqvc') diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c index 6920b5e..8533c2b 100644 --- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c +++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.c @@ -112,15 +112,17 @@ static void protocol_handle_recv(fastd_peer_t *peer, fastd_buffer_t buffer) { goto fail; fastd_buffer_t recv_buffer; - bool ok = false; + bool ok = false, reordered; if (is_session_valid(&peer->protocol_state->old_session)) { - if (peer->protocol_state->old_session.method->provider->decrypt(peer, peer->protocol_state->old_session.method_state, &recv_buffer, buffer)) + reordered = false; + if (peer->protocol_state->old_session.method->provider->decrypt(peer, peer->protocol_state->old_session.method_state, &recv_buffer, buffer, &reordered)) ok = true; } if (!ok) { - if (peer->protocol_state->session.method->provider->decrypt(peer, peer->protocol_state->session.method_state, &recv_buffer, buffer)) { + reordered = false; + if (peer->protocol_state->session.method->provider->decrypt(peer, peer->protocol_state->session.method_state, &recv_buffer, buffer, &reordered)) { ok = true; if (peer->protocol_state->old_session.method) { @@ -150,7 +152,7 @@ static void protocol_handle_recv(fastd_peer_t *peer, fastd_buffer_t buffer) { fastd_peer_seen(peer); if (recv_buffer.len) - fastd_handle_receive(peer, recv_buffer); + fastd_handle_receive(peer, recv_buffer, reordered); else fastd_buffer_free(recv_buffer); -- cgit v1.2.3