summaryrefslogtreecommitdiffstats
path: root/src/protocol_ec25519_fhmqvc.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-02-27 04:42:50 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-02-27 04:42:50 +0100
commitddb4831f065b6e539d33051fb4c94711e06ed72f (patch)
tree8c2e74da542cce596f68c4fcdfd0f3462e1a513e /src/protocol_ec25519_fhmqvc.c
parent3fb7af313fbfef9e0b8195cc44b176dd3fccb15e (diff)
downloadfastd-ddb4831f065b6e539d33051fb4c94711e06ed72f.tar
fastd-ddb4831f065b6e539d33051fb4c94711e06ed72f.zip
Don't set the peer address for temporary peers before the session is actually established
Doing so could lead to duplicate address entries in different peers, causing very strange behaviour. Add additional parameters for the local and the peer address to fastd_shell_exec() to allow the on-verify script to use this information nevertheless.
Diffstat (limited to 'src/protocol_ec25519_fhmqvc.c')
-rw-r--r--src/protocol_ec25519_fhmqvc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol_ec25519_fhmqvc.c b/src/protocol_ec25519_fhmqvc.c
index 4b0e997..061726f 100644
--- a/src/protocol_ec25519_fhmqvc.c
+++ b/src/protocol_ec25519_fhmqvc.c
@@ -568,7 +568,7 @@ static inline fastd_peer_t* add_temporary(fastd_context_t *ctx, fastd_socket_t *
return NULL;
}
- fastd_peer_t *peer = fastd_peer_add_temporary(ctx, sock, address);
+ fastd_peer_t *peer = fastd_peer_add_temporary(ctx);
peer->protocol_config = malloc(sizeof(fastd_protocol_peer_config_t));
memcpy(peer->protocol_config->public_key.p, key, PUBLICKEYBYTES);
@@ -576,7 +576,7 @@ static inline fastd_peer_t* add_temporary(fastd_context_t *ctx, fastd_socket_t *
/* Ugly hack */
peer->protocol_state->last_serial--;
- if (!fastd_peer_verify_temporary(ctx, peer)) {
+ if (!fastd_peer_verify_temporary(ctx, peer, &sock->addr->addr, address)) {
fastd_peer_delete(ctx, peer);
return NULL;
}