@ -364,7 +364,9 @@ void topo_group_new_conn(struct TOPO_GROUP* group, struct ETCP_CONN* conn) {
struct TOPO_NODEQ * peer_nq = topo_node_find_by_id ( group , conn - > peer_node_id ) ;
topo_group_add_to_senders ( group , conn ) ;
if ( peer_nq & & peer_nq - > alien ) { DEBUG_INFO ( DEBUG_CATEGORY_BGP , " peer 0x%016llx is alien, skipping route exchange " , ( unsigned long long ) conn - > peer_node_id ) ; return ; }
if ( peer_nq & & peer_nq - > alien ) { DEBUG_INFO ( DEBUG_CATEGORY_BGP , " peer 0x%016llx is alien, skipping route exchange " , ( unsigned long long ) conn - > peer_node_id ) ; DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " topo_group_new_conn: peer=%016llx group=%016llx type=%d ch=%s ALIEN=1 — SKIP " , ( unsigned long long ) conn - > peer_node_id , ( unsigned long long ) group - > group_id , group - > group_type , group - > channel_id ) ; return ; }
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " topo_group_new_conn: peer=%016llx group=%016llx type=%d ch=%s alien=%d " , ( unsigned long long ) conn - > peer_node_id , ( unsigned long long ) group - > group_id , group - > group_type , group - > channel_id , peer_nq ? peer_nq - > alien : - 1 ) ;
struct ll_entry * entry = conn - > instance - > connections - > head ;
while ( entry ) { struct conn_queue_entry * ce = ( struct conn_queue_entry * ) entry - > data ; struct ETCP_LINK * l = ce - > conn - > links ; while ( l ) { if ( l - > initialized & & l - > conn & & l - > nat_check_status < NAT_CHECK_IN_PROGRESS ) topo_group_start_link_nat_check ( group , l ) ; l = l - > next ; } entry = entry - > next ; }
@ -558,6 +560,7 @@ int topo_group_process_nodeinfo(struct TOPO_GROUP* group, struct ETCP_CONN* from
uint8_t new_ver = ni - > ver ;
if ( nodeinfo1 & & ( int8_t ) ( nodeinfo1 - > last_ver - new_ver ) > = 0 ) {
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " NODEINFO skip (stale ver): node=%016llx cur_ver=%d new_ver=%d from=%s " , ( unsigned long long ) node_id , nodeinfo1 - > last_ver , new_ver , from - > log_name ) ;
int new_hops = ni - > hop_count + 1 ;
if ( new_hops < = MAX_HOPS ) {
uint64_t hop_list [ MAX_HOPS ] ;
@ -639,12 +642,15 @@ int topo_group_process_nodeinfo(struct TOPO_GROUP* group, struct ETCP_CONN* from
sqlite3 * sdb = group - > instance - > topo_groups - > topo_sqlite_db ;
if ( sdb ) {
topo_node_sqlite_node_put ( sdb , nodeinfo1 ) ;
if ( group - > group_type = = TOPO_GROUP_TYPE_CHAT & & group - > channel_id [ 0 ] )
if ( group - > group_type = = TOPO_GROUP_TYPE_CHAT & & group - > channel_id [ 0 ] ) {
topo_node_sqlite_member_put ( sdb , group - > channel_id , node_id , NULL , NULL ) ;
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " SQLite member_put: ch=%s node=%016llx " , group - > channel_id , ( unsigned long long ) node_id ) ;
}
}
}
if ( group - > instance - > control_srv ) control_server_notify_node_change ( group - > instance - > control_srv , nodeinfo1 ) ;
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " node_updated_cb: node=%016llx has_cb=%d ch=%s type=%d " , ( unsigned long long ) node_id , group - > instance - > topo_groups - > node_updated_cb ? 1 : 0 , group - > channel_id , group - > group_type ) ;
if ( group - > instance - > topo_groups - > node_updated_cb )
group - > instance - > topo_groups - > node_updated_cb ( group - > instance , node_id , ni - > public_key , ni - > ed25519_public_key ) ;