@ -750,6 +750,8 @@ int route_bgp_process_nodeinfo(struct ROUTE_BGP* bgp, struct ETCP_CONN* from, co
struct NODEINFO_Q * nodeinfo1 = nodeinfo_find_by_id ( bgp , node_id ) ;
uint8_t new_ver = ni - > ver ;
if ( node_id = = bgp - > instance - > node_id ) return 0 ;
if ( nodeinfo1 & & ( int8_t ) ( nodeinfo1 - > last_ver - new_ver ) > = 0 ) {
int new_hops = ni - > hop_count + 1 ;
if ( new_hops < = MAX_HOPS ) {
@ -810,22 +812,6 @@ int route_bgp_process_nodeinfo(struct ROUTE_BGP* bgp, struct ETCP_CONN* from, co
memcpy ( & nodeinfo1 - > node , ni , sizeof ( struct NODEINFO ) + dyn_size ) ;
}
/* Если это наш local_node (по node_id), обновляем его данные */
if ( node_id = = bgp - > instance - > node_id & & bgp - > local_node ) {
uint8_t * dyn_src = ( uint8_t * ) & nodeinfo1 - > node + sizeof ( struct NODEINFO ) ;
uint8_t * dyn_dst = ( uint8_t * ) & bgp - > local_node - > node + sizeof ( struct NODEINFO ) ;
int dyn_sz = nodeinfo1 - > node . node_name_len +
nodeinfo1 - > node . local_v4_sockets * sizeof ( struct NODEINFO_IPV4_SOCKET_META ) +
nodeinfo1 - > node . local_v4_addrs * sizeof ( struct NODEINFO_IPV4_ADDR ) +
nodeinfo1 - > node . local_v6_sockets * sizeof ( struct NODEINFO_IPV6_SOCKET_META ) +
nodeinfo1 - > node . local_v6_addrs * sizeof ( struct NODEINFO_IPV6_ADDR ) +
nodeinfo1 - > node . local_v4_subnets * sizeof ( struct NODEINFO_IPV4_SUBNET ) +
nodeinfo1 - > node . local_v6_subnets * sizeof ( struct NODEINFO_IPV6_SUBNET ) ;
memcpy ( dyn_dst , dyn_src , dyn_sz ) ;
bgp - > local_node - > node . ver = nodeinfo1 - > node . ver ;
bgp - > local_node - > last_ver = new_ver ;
DEBUG_INFO ( DEBUG_CATEGORY_BGP , " Updated local_node from remote NODEINFO: node=%016llx " , ( unsigned long long ) node_id ) ;
}
nodeinfo1 - > paths = paths ;
nodeinfo1 - > last_ver = new_ver ;