summaryrefslogtreecommitdiffstats
path: root/src/protocols/ec25519_fhmqvc
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-03-23 07:20:02 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-03-23 07:20:02 +0100
commit5f66dbf5d1c26851e0a47269abbc44fe3524e4e2 (patch)
tree9019d7375f4949d37e52cbba55fc270326e9b4e5 /src/protocols/ec25519_fhmqvc
parentdeb76974e225aa70825587e3eb6705634471f58c (diff)
downloadfastd-5f66dbf5d1c26851e0a47269abbc44fe3524e4e2.tar
fastd-5f66dbf5d1c26851e0a47269abbc44fe3524e4e2.zip
peer: create interface when the connection has been established and no interface exists yet
Allows using dynamic interfaces with dynamic peers.
Diffstat (limited to 'src/protocols/ec25519_fhmqvc')
-rw-r--r--src/protocols/ec25519_fhmqvc/handshake.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c
index 7dda0a1..bbe572d 100644
--- a/src/protocols/ec25519_fhmqvc/handshake.c
+++ b/src/protocols/ec25519_fhmqvc/handshake.c
@@ -156,9 +156,13 @@ static bool establish(fastd_peer_t *peer, const fastd_method_info_t *method, fas
return false;
}
+ if (!fastd_peer_set_established(peer)) {
+ fastd_peer_reset(peer);
+ return false;
+ }
+
peer->establish_handshake_timeout = ctx.now + MIN_HANDSHAKE_INTERVAL;
fastd_peer_seen(peer);
- fastd_peer_set_established(peer);
pr_verbose("new session with %P established using method `%s'%s.", peer, method->name, salt ? "" : " (compat mode)");