diff --git a/src/routing_layer/nat_detection.c b/src/routing_layer/nat_detection.c index 1d51f62f..c13e8fa0 100644 --- a/src/routing_layer/nat_detection.c +++ b/src/routing_layer/nat_detection.c @@ -290,7 +290,7 @@ static int select_pair(struct nat_socket *state) { } } } - if (!best.group && single.group && !state->using_fallback) { + if (!best.group && single.group && !state->using_fallback && !state->prefer_fresh) { best = single; observer_address = single_address; memcpy(observer_key, single_key, 32); } if (!best.group) { diff --git a/tests/test_nat_detection_faults.c b/tests/test_nat_detection_faults.c index 5eaab589..e35bedf2 100644 --- a/tests/test_nat_detection_faults.c +++ b/tests/test_nat_detection_faults.c @@ -34,7 +34,8 @@ int __wrap_etcp_route_send(struct UTUN_INSTANCE *instance, uint64_t group, uint6 struct ll_entry *entry, int force, int mode) { if (fault.fixture && fault.mode == FAULT_CONTROL_STALL && instance == fault.helper && destination == fault.observer->node_id && entry->len && entry->dgram[0] == ETCP_RT_ID_NAT_DETECTION) { - fault.dropped++; queue_entry_free(entry); return 0; + DEBUG_INFO(DEBUG_CATEGORY_NAT, "fault fixture: helper control result dropped before observer delivery"); + fault.dropped++; queue_dgram_free(entry); queue_entry_free(entry); return 0; } return __real_etcp_route_send(instance, group, destination, entry, force, mode); }