|
|
|
|
@ -333,9 +333,16 @@ static int route_bgp_send_route_single(struct ROUTE_BGP* bgp, struct ETCP_CONN*
|
|
|
|
|
char sr_ep_buf[16]; |
|
|
|
|
format_ip(route->network, sr_net_buf); |
|
|
|
|
format_ip(ntohl(endpoint_ip), sr_ep_buf); |
|
|
|
|
DEBUG_DEBUG(DEBUG_CATEGORY_BGP, "Sending route: %s/%d to conn %p, endpoint=%s:%d", |
|
|
|
|
sr_net_buf, route->prefix_length & 0x3F, (void*)conn, |
|
|
|
|
sr_ep_buf, ntohs(endpoint_port)); |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_BGP, "Sending route: %s/%d type=%s flags=0x%x " |
|
|
|
|
"metrics{hops=%u lat=%u kbps=%u loss=%u metric=%u} " |
|
|
|
|
"endpoint=%s:%u node_id=%016llx", |
|
|
|
|
sr_net_buf, route->prefix_length, |
|
|
|
|
route_type_to_str(route->type), route->flags, |
|
|
|
|
route->metrics.hop_count, route->metrics.latency_ms, |
|
|
|
|
route->metrics.bandwidth_kbps, route->metrics.packet_loss_rate, |
|
|
|
|
route->metrics.metric, |
|
|
|
|
sr_ep_buf, ntohs(endpoint_port), |
|
|
|
|
(unsigned long long)route->destination_node_id); |
|
|
|
|
|
|
|
|
|
// Отправляем через ETCP
|
|
|
|
|
if (etcp_send(conn, entry) != 0) { |
|
|
|
|
@ -368,20 +375,6 @@ static void route_bgp_send_route(struct ROUTE_BGP* bgp, struct ETCP_CONN* conn,
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
char dbg_net[16], dbg_ep[16]; |
|
|
|
|
format_ip(route->network, dbg_net); |
|
|
|
|
format_ip(route->endpoint_ip, dbg_ep); |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_BGP, "Sending route: %s/%d type=%s flags=0x%x " |
|
|
|
|
"metrics{hops=%u lat=%u kbps=%u loss=%u metric=%u} " |
|
|
|
|
"endpoint=%s:%u node_id=%016llx", |
|
|
|
|
dbg_net, route->prefix_length, |
|
|
|
|
route_type_to_str(route->type), route->flags, |
|
|
|
|
route->metrics.hop_count, route->metrics.latency_ms, |
|
|
|
|
route->metrics.bandwidth_kbps, route->metrics.packet_loss_rate, |
|
|
|
|
route->metrics.metric, |
|
|
|
|
dbg_ep, route->endpoint_port, |
|
|
|
|
(unsigned long long)route->destination_node_id); |
|
|
|
|
|
|
|
|
|
// Для LOCAL маршрутов - отправляем с нескольких endpoints если есть PUBLIC или NAT серверы
|
|
|
|
|
if (route->type == ROUTE_TYPE_LOCAL && conn->links) { |
|
|
|
|
// Сначала отправляем PUBLIC (приоритет), затем NAT
|
|
|
|
|
|