summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/peer.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/peer.c b/src/peer.c
index d50fdec..fa48b8d 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -363,19 +363,21 @@ bool fastd_peer_claim_address(fastd_context_t *ctx, fastd_peer_t *new_peer, fast
else {
fastd_peer_t *peer;
for (peer = ctx->peers; peer; peer = peer->next) {
- if (!fastd_peer_address_equal(&peer->address, remote_addr))
- continue;
-
if (peer == new_peer)
- break;
+ continue;
- if (!fastd_peer_is_floating(peer)) {
+ if (fastd_peer_owns_address(ctx, peer, remote_addr)) {
reset_peer_address(ctx, new_peer);
return false;
}
- reset_peer_address(ctx, peer);
- break;
+ if (fastd_peer_address_equal(&peer->address, remote_addr)) {
+ if (fastd_peer_is_established(peer))
+ return false;
+
+ reset_peer_address(ctx, peer);
+ break;
+ }
}
}