loggin update

This commit is contained in:
2026-05-02 18:55:37 +07:00
parent ebb123f4ea
commit 738fa8ca9b
18 changed files with 417 additions and 137 deletions
+9 -2
View File
@@ -6,7 +6,6 @@ use netrunner_core::{
use smoltcp::{
iface::SocketHandle,
socket::{tcp, udp},
time::Duration,
wire::{
Icmpv4Message, Icmpv4Packet, Icmpv6Message, Icmpv6Packet, IpAddress, IpEndpoint,
Ipv6Address,
@@ -15,7 +14,7 @@ use smoltcp::{
use std::{collections::VecDeque, sync::atomic::Ordering};
use tokio::sync::{mpsc, oneshot};
use netrunner_logger::{debug, info};
use netrunner_logger::{debug, info, instrument};
pub struct ConnectionCore<T> {
pub handle: SocketHandle,
pub tx: mpsc::Sender<T>,
@@ -210,6 +209,10 @@ impl TcpConnection {
self.pending_bytes
}
#[instrument(skip(rx_smol, handshake_tx, tx_tunnel), fields(
socket_id = socket_id,
dst = %target
))]
pub fn spawn(
socket_id: u64,
dst_ip: std::net::Ipv4Addr,
@@ -318,6 +321,10 @@ impl UdpConnection {
true
}
#[instrument(skip(rx_smol, tx_tunnel), fields(
socket_id = socket_id,
dst = %target
))]
pub fn spawn(
socket_id: u64,
dst_ip: std::net::Ipv4Addr,
-2
View File
@@ -378,7 +378,6 @@ impl EngineBuilder {
let phys_gw = "192.168.1.1";
for domain in excluded_domains {
// Резолвим домен средствами ОС (через системный DNS, не наш)
if let Ok(addrs) = tokio::net::lookup_host(format!("{}:443", domain)).await {
for addr in addrs {
if let std::net::IpAddr::V4(ipv4) = addr.ip() {
@@ -386,7 +385,6 @@ impl EngineBuilder {
"Adding exception route for domain {} -> IP {}",
domain, ipv4
);
// Прописываем маршрут в ОС мимо туннеля
#[cfg(target_os = "linux")]
let _ = crate::tun::routing::run_cmd_ext(
&format!("ip route add {} via {}", ipv4, phys_gw),