|
|
|
|
@ -1421,7 +1421,8 @@ uint64_t nat_detection_probe_delay(struct NAT_DETECTION *detector) {
|
|
|
|
|
if (state->socket->is_tcp || !state->reservation_fingerprint || state->cold_until <= now || |
|
|
|
|
(!detector->automatic && !state->phase && !state->forced) || |
|
|
|
|
(state->completed_tb && !state->phase && !state->cycling && !state->forced && state->due > now + 2500) || |
|
|
|
|
(state->measured_profile.source == ADDRESS_SOURCE_ETCP && state->measured_profile.mapping && state->measured_profile.inbound)) |
|
|
|
|
(!state->phase && !state->cycling && !state->forced && state->measured_profile.source == ADDRESS_SOURCE_ETCP && |
|
|
|
|
state->measured_profile.mapping && state->measured_profile.inbound)) |
|
|
|
|
continue; |
|
|
|
|
if (state->cold_until - now > delay) delay = state->cold_until - now; |
|
|
|
|
} |
|
|
|
|
@ -1437,7 +1438,8 @@ int nat_detection_ping_allowed(struct NAT_DETECTION *detector, struct ETCP_SOCKE
|
|
|
|
|
if (!state || (!state->reservation_fingerprint && !state->available_fingerprint) || state->cold_until <= get_time_tb() || |
|
|
|
|
(!detector->automatic && !state->phase && !state->forced) || |
|
|
|
|
(state->completed_tb && !state->phase && !state->cycling && !state->forced && state->due > get_time_tb() + 2500) || |
|
|
|
|
(state->measured_profile.source == ADDRESS_SOURCE_ETCP && state->measured_profile.mapping && state->measured_profile.inbound)) return 1; |
|
|
|
|
(!state->phase && !state->cycling && !state->forced && state->measured_profile.source == ADDRESS_SOURCE_ETCP && |
|
|
|
|
state->measured_profile.mapping && state->measured_profile.inbound)) return 1; |
|
|
|
|
uint64_t peer = sc_derive_node_id_from_pubkey(peer_key); |
|
|
|
|
if (!(flags & ETCP_PING_FLAG_OBSERVE)) { |
|
|
|
|
history_load(state); |
|
|
|
|
|