diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-11-04 17:06:35 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-11-04 17:06:35 +0100 |
commit | 51aa24d4a2825a050a6c048d69c24a10d98d4993 (patch) | |
tree | b48daca13ccc90f273907b73b5ed4d63c7e60b31 | |
parent | 2791d3bc994737f8f2fc9176e741c96ab0dcddc6 (diff) | |
download | fastd-51aa24d4a2825a050a6c048d69c24a10d98d4993.tar fastd-51aa24d4a2825a050a6c048d69c24a10d98d4993.zip |
Reset dynamic peer if there is an established session and resolve fails
Fixes an assertion fail when address resolution fails during session refresh.
-rw-r--r-- | src/peer.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -319,7 +319,11 @@ bool fastd_peer_address_equal(const fastd_peer_address *addr1, const fastd_peer_ } bool fastd_peer_claim_address(fastd_context *ctx, fastd_peer *new_peer, fastd_socket *sock, const fastd_peer_address *addr) { - if (addr->sa.sa_family != AF_UNSPEC) { + if (addr->sa.sa_family == AF_UNSPEC) { + if (fastd_peer_is_established(new_peer)) + fastd_peer_reset(ctx, new_peer); + } + else { fastd_peer *peer; for (peer = ctx->peers; peer; peer = peer->next) { if (fastd_peer_address_equal(&peer->address, addr)) { |