diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-04-17 21:42:22 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-04-17 21:44:02 +0200 |
commit | daf3d6e8db9ef39b50dce040f864fb409bd7044a (patch) | |
tree | 49abaa8d953a515f4b8b445d46f7480ee1f8c3fd /src/protocol_ec25519_fhmqvc.c | |
parent | 41ea8e454937444da4d2bb33fe768adb5b02776b (diff) | |
download | fastd-daf3d6e8db9ef39b50dce040f864fb409bd7044a.tar fastd-daf3d6e8db9ef39b50dce040f864fb409bd7044a.zip |
Fix handling of the local address in shell commands
Without this fix, using on-establish/disestablish/verify would cause a strange
zero port when a bind with a random port was used, and a segmentation fault with
dynamic binds.
Diffstat (limited to 'src/protocol_ec25519_fhmqvc.c')
-rw-r--r-- | src/protocol_ec25519_fhmqvc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol_ec25519_fhmqvc.c b/src/protocol_ec25519_fhmqvc.c index eea95e4..d0dad5b 100644 --- a/src/protocol_ec25519_fhmqvc.c +++ b/src/protocol_ec25519_fhmqvc.c @@ -627,7 +627,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, &sock->addr->addr, address)) { + if (!fastd_peer_verify_temporary(ctx, peer, sock->bound_addr, address)) { pr_debug(ctx, "ignoring handshake from %P[%I] (verification failed)", peer, address); fastd_peer_delete(ctx, peer); return NULL; @@ -674,7 +674,7 @@ static void protocol_handshake_handle(fastd_context_t *ctx, fastd_socket_t *sock } if (fastd_peer_is_temporary(peer) && !temporary_added) { - if (!fastd_peer_verify_temporary(ctx, peer, &sock->addr->addr, address)) { + if (!fastd_peer_verify_temporary(ctx, peer, sock->bound_addr, address)) { pr_debug(ctx, "ignoring handshake from %P[%I] (verification failed)", peer, address); return; } |