1
This commit is contained in:
1 parent
e8dc0abb31
commit
17e1a193c5
3 files changed
+17
-20
No files matched your search
@@ -479,8 +479,12 @@ struct ETCP_SOCKET* etcp_socket_add(struct UTUN_INSTANCE* instance, struct socka
|
||||
free(e_sock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct sockaddr_in* sin = (struct sockaddr_in*)ip;
|
||||
char addr_str[INET_ADDRSTRLEN];
|
||||
inet_ntop(AF_INET, &sin->sin_addr, addr_str, INET_ADDRSTRLEN);
|
||||
|
||||
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "[ETCP] Successfully bound socket to local address, family=%d", ip->ss_family);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "[ETCP] Successfully bound socket to local address, family=%d %s:%d", ip->ss_family, addr_str, ntohs(sin->sin_port));
|
||||
}
|
||||
|
||||
e_sock->instance = instance;
|
||||
|
||||
+10
-17
@@ -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
|
||||
|
||||
+2
-2
@@ -273,8 +273,8 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
debug_config_init();
|
||||
debug_set_level(DEBUG_LEVEL_TRACE);
|
||||
debug_set_categories(DEBUG_CATEGORY_ALL & ~DEBUG_CATEGORY_UASYNC & ~DEBUG_CATEGORY_TIMERS & ~DEBUG_CATEGORY_CRYPTO & ~DEBUG_CATEGORY_ETCP & ~DEBUG_CATEGORY_CONNECTION); // Enable all except uasync
|
||||
// debug_set_categories(DEBUG_CATEGORY_ALL);
|
||||
// debug_set_categories(DEBUG_CATEGORY_ALL & ~DEBUG_CATEGORY_UASYNC & ~DEBUG_CATEGORY_TIMERS & ~DEBUG_CATEGORY_CRYPTO & ~DEBUG_CATEGORY_ETCP & ~DEBUG_CATEGORY_CONNECTION); // Enable all except uasync
|
||||
debug_set_categories(DEBUG_CATEGORY_ALL);
|
||||
debug_enable_function_name(1);
|
||||
|
||||
if (args.debug_config) {
|
||||
|
||||
Reference in new issue
Block a user