nat: try known mapping peers before observer-only fallback

This commit is contained in:
evgeny committed 2026-10-17 17:57:15 +02:00
1 parent b9a5981f5c
commit 5a8b05c50f
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -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) {
+2 -1
View File
@@ -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);
}