From 4b07d59043db068910664fcfeba27004828b05de Mon Sep 17 00:00:00 2001 From: evgeny Date: Sun, 2 Aug 2026 20:42:40 +0300 Subject: [PATCH] chat: skip own addresses from remote in member_sync_recv Remote peers should not overwrite local node_addresses. When member_sync_recv processes data about our own node_id, we trust locally-synced addresses (from sync_my_addresses) and ignore address data from the remote peer. --- src/chat/member_sync.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chat/member_sync.c b/src/chat/member_sync.c index b3722e02..c8afa237 100644 --- a/src/chat/member_sync.c +++ b/src/chat/member_sync.c @@ -405,7 +405,10 @@ static int _member_apply_items(void* ctx, const char* ns, uint64_t from_peer, } } if (adm_ver < 0) { mp += consumed; mrem -= (size_t)consumed; continue; } - member_sync_put(inst, ns, nid, x25, ed, jsig, jts, usig, uts, nm, addrs, (int)ac, atags[0] ? atags : NULL, atsig, adm_storage); + member_sync_put(inst, ns, nid, x25, ed, jsig, jts, usig, uts, nm, + nid != inst->node_id ? addrs : NULL, + nid != inst->node_id ? (int)ac : 0, + atags[0] ? atags : NULL, atsig, adm_storage); DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "%s: [ADDR_SYNC] member_sync recv ns=%s nid=0x%016llx ac=%d adm_ver=%d storage=%d", MS_ID, ns, (unsigned long long)nid, ac, adm_ver, adm_storage); /* fire node_props_changed callbacks */ { struct ms_props_cbk* pc = g_props_cbks;