summaryrefslogtreecommitdiffstats
path: root/src/handshake.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-03-31 21:18:07 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-03-31 21:18:07 +0200
commit4f0cfe26bf5445fc06a59a6db47cb2fa3158b87b (patch)
tree05396b7c13482ab27beb4593236b260c4bdf06c3 /src/handshake.c
parentf25c92359e57b1e97c86174067485acf6a9445de (diff)
downloadfastd-4f0cfe26bf5445fc06a59a6db47cb2fa3158b87b.tar
fastd-4f0cfe26bf5445fc06a59a6db47cb2fa3158b87b.zip
Trigger handshake when unexpected data is received from a floating peer
Diffstat (limited to 'src/handshake.c')
-rw-r--r--src/handshake.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/handshake.c b/src/handshake.c
index ce8895d..839951b 100644
--- a/src/handshake.c
+++ b/src/handshake.c
@@ -122,8 +122,10 @@ void fastd_handshake_handle(fastd_context *ctx, fastd_peer *peer, fastd_buffer b
handshake.req_id = packet->req_id;
- if (handshake.records[RECORD_HANDSHAKE_TYPE].length != 1)
+ if (handshake.records[RECORD_HANDSHAKE_TYPE].length != 1) {
+ pr_debug(ctx, "received handshake without handshake type from %P", peer);
goto end_free;
+ }
handshake.type = AS_UINT8(handshake.records[RECORD_HANDSHAKE_TYPE]);