diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-06-06 22:38:36 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2012-06-06 22:38:36 +0200 |
commit | 33ec56398316af14eec762406f21e649fcc3cbf2 (patch) | |
tree | 02564aa8e99f58d170fd8d844cdc0415a44a4045 /src/fastd.c | |
parent | 7297dd73d5bfa05f829bf44cd8480627d5b387f8 (diff) | |
download | fastd-33ec56398316af14eec762406f21e649fcc3cbf2.tar fastd-33ec56398316af14eec762406f21e649fcc3cbf2.zip |
Limit resolve frequency
Diffstat (limited to 'src/fastd.c')
-rw-r--r-- | src/fastd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fastd.c b/src/fastd.c index afa36eb..1f5c2bf 100644 --- a/src/fastd.c +++ b/src/fastd.c @@ -416,7 +416,7 @@ static void handle_tasks(fastd_context *ctx) { switch (task->type) { case TASK_HANDSHAKE: if (fastd_peer_is_dynamic(task->peer)) - fastd_resolve_peer(ctx, task->peer->config); + fastd_resolve_peer(ctx, task->peer); else send_handshake(ctx, task->peer); break; @@ -576,6 +576,8 @@ static void handle_resolv_returns(fastd_context *ctx) { if (!fastd_peer_config_matches_dynamic(peer->config, &resolve_return.constraints)) continue; + peer->last_resolve_return = ctx->now; + if (fastd_peer_claim_address(ctx, peer, &resolve_return.addr)) { send_handshake(ctx, peer); } |