summaryrefslogtreecommitdiffstats
path: root/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-30 17:14:10 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-30 17:14:10 +0200
commit23e76b0d25da0b6884a445cba15bbba40afb6df8 (patch)
treef58cccd7f2f40839f25e6e77eb0baa5169f9c347 /src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
parent002fd7132a7368a3103ba6d5e09fd8e546a2bfa3 (diff)
downloadfastd-23e76b0d25da0b6884a445cba15bbba40afb6df8.tar
fastd-23e76b0d25da0b6884a445cba15bbba40afb6df8.zip
Correctly update seen time when data is received from a peer
Diffstat (limited to 'src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c')
-rw-r--r--src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c b/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
index 5b05041..4888589 100644
--- a/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
+++ b/src/protocol_ec25519_fhmqvc_xsalsa20_poly1305.c
@@ -362,7 +362,7 @@ static void establish(fastd_context *ctx, fastd_peer *peer, const fastd_peer_con
peer->protocol_state->session.receive_nonce[i] = 0;
}
- peer->seen = ctx->now;
+ fastd_peer_seen(ctx, peer);
if (peer_config != peer->config) {
fastd_peer *perm_peer;
@@ -614,6 +614,8 @@ static void protocol_handle_recv(fastd_context *ctx, fastd_peer *peer, fastd_buf
goto end;
}
+ fastd_peer_seen(ctx, peer);
+
fastd_buffer_push_head(&recv_buffer, crypto_secretbox_xsalsa20poly1305_ZEROBYTES);
fastd_task_put_handle_recv(ctx, peer, recv_buffer);