Browse Source

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.
topo_upd
evgeny 2 months ago
parent
commit
4b07d59043
  1. 5
      src/chat/member_sync.c

5
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;

Loading…
Cancel
Save