|
|
|
|
@ -1204,6 +1204,9 @@ static uint64_t candidate_fingerprint(struct nat_socket *state, int ready) {
|
|
|
|
|
group_total += hash; |
|
|
|
|
} |
|
|
|
|
if (ready || (candidates >= 2 && observers)) total += group_total; |
|
|
|
|
if (!ready) DEBUG_DEBUG(DEBUG_CATEGORY_NAT, "NAT cold group candidates node=%016llx socket=%s group=%016llx candidates=%u observers=%u", |
|
|
|
|
(unsigned long long)detector->instance->node_id, state->socket->name, |
|
|
|
|
(unsigned long long)group->group_id, candidates, observers); |
|
|
|
|
} |
|
|
|
|
return total; |
|
|
|
|
} |
|
|
|
|
@ -1221,6 +1224,9 @@ uint64_t nat_detection_probe_delay(struct NAT_DETECTION *detector) {
|
|
|
|
|
if (!state) continue; |
|
|
|
|
uint64_t fingerprint = candidate_fingerprint(state, 0); |
|
|
|
|
if (fingerprint != state->reservation_fingerprint) { |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_NAT, "NAT cold reservation node=%016llx socket=%s previous=%016llx current=%016llx", |
|
|
|
|
(unsigned long long)detector->instance->node_id, socket->name, |
|
|
|
|
(unsigned long long)state->reservation_fingerprint, (unsigned long long)fingerprint); |
|
|
|
|
state->reservation_fingerprint = fingerprint; |
|
|
|
|
if (fingerprint) state->cold_until = now + NAT_ROUND_TB + 2500; |
|
|
|
|
} |
|
|
|
|
|