mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-10 00:26:59 +00:00
Demote 35 info-level log messages to debug for cleaner production output
Reduce info-level noise by moving intermediate steps, periodic telemetry, cross-connection resolution details, and redundant messages to debug. Info output now focuses on operator-relevant state changes: lifecycle events, peer promotions, session establishment, parent switches, and transport start/stop. Key categories demoted: - Handshake cross-connection resolution mechanics (10 messages) - Periodic MMP link/session metric reports (4 messages) - TUN cleanup messages redundant with lifecycle shutdown (4 messages) - Transport "packet channel closed" shutdown messages (4 messages) - Retry scheduling, discovery lookup initiation, other intermediate steps Change default RUST_LOG from debug to info in systemd unit files.
This commit is contained in:
@@ -10,7 +10,7 @@ Restart=on-failure
|
|||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
# Logging: RUST_LOG controls verbosity.
|
# Logging: RUST_LOG controls verbosity.
|
||||||
Environment=RUST_LOG=debug
|
Environment=RUST_LOG=info
|
||||||
|
|
||||||
# Control socket directory (/run/fips/).
|
# Control socket directory (/run/fips/).
|
||||||
# Group-accessible so 'fips' group members can use fipsctl/fipstop.
|
# Group-accessible so 'fips' group members can use fipsctl/fipstop.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ Restart=on-failure
|
|||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|
||||||
# Logging: RUST_LOG controls verbosity.
|
# Logging: RUST_LOG controls verbosity.
|
||||||
Environment=RUST_LOG=debug
|
Environment=RUST_LOG=info
|
||||||
|
|
||||||
# Control socket directory (/run/fips/).
|
# Control socket directory (/run/fips/).
|
||||||
# Group-accessible so 'fips' group members can use fipsctl/fipstop.
|
# Group-accessible so 'fips' group members can use fipsctl/fipstop.
|
||||||
|
|||||||
+3
-3
@@ -7,7 +7,7 @@ use fips::config::{resolve_identity, IdentitySource};
|
|||||||
use fips::version;
|
use fips::version;
|
||||||
use fips::{Config, Node};
|
use fips::{Config, Node};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use tracing::{error, info, warn, Level};
|
use tracing::{debug, error, info, warn, Level};
|
||||||
use tracing_subscriber::{fmt, EnvFilter};
|
use tracing_subscriber::{fmt, EnvFilter};
|
||||||
|
|
||||||
/// FIPS mesh network daemon
|
/// FIPS mesh network daemon
|
||||||
@@ -41,7 +41,7 @@ async fn main() {
|
|||||||
info!("FIPS {} starting", version::short_version());
|
info!("FIPS {} starting", version::short_version());
|
||||||
|
|
||||||
// Load configuration
|
// Load configuration
|
||||||
info!("Loading configuration");
|
debug!("Loading configuration");
|
||||||
let (config, loaded_paths) = if let Some(config_path) = &args.config {
|
let (config, loaded_paths) = if let Some(config_path) = &args.config {
|
||||||
// Explicit config file specified - load only that file
|
// Explicit config file specified - load only that file
|
||||||
match Config::load_file(config_path) {
|
match Config::load_file(config_path) {
|
||||||
@@ -88,7 +88,7 @@ async fn main() {
|
|||||||
// Create node with resolved identity
|
// Create node with resolved identity
|
||||||
let mut config = config;
|
let mut config = config;
|
||||||
config.node.identity.nsec = Some(resolved.nsec);
|
config.node.identity.nsec = Some(resolved.nsec);
|
||||||
info!("Creating node");
|
debug!("Creating node");
|
||||||
let mut node = match Node::new(config) {
|
let mut node = match Node::new(config) {
|
||||||
Ok(node) => node,
|
Ok(node) => node,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
use super::protocol::Response;
|
use super::protocol::Response;
|
||||||
use crate::node::Node;
|
use crate::node::Node;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tracing::info;
|
use tracing::debug;
|
||||||
|
|
||||||
/// Dispatch a mutating command to the appropriate handler.
|
/// Dispatch a mutating command to the appropriate handler.
|
||||||
pub async fn dispatch(node: &mut Node, command: &str, params: Option<&Value>) -> Response {
|
pub async fn dispatch(node: &mut Node, command: &str, params: Option<&Value>) -> Response {
|
||||||
@@ -38,7 +38,7 @@ async fn connect(node: &mut Node, params: Option<&Value>) -> Response {
|
|||||||
None => return Response::error("missing 'transport' parameter"),
|
None => return Response::error("missing 'transport' parameter"),
|
||||||
};
|
};
|
||||||
|
|
||||||
info!(npub = %npub, address = %address, transport = %transport, "API connect requested");
|
debug!(npub = %npub, address = %address, transport = %transport, "API connect requested");
|
||||||
|
|
||||||
match node.api_connect(npub, address, transport).await {
|
match node.api_connect(npub, address, transport).await {
|
||||||
Ok(data) => Response::ok(data),
|
Ok(data) => Response::ok(data),
|
||||||
@@ -59,7 +59,7 @@ fn disconnect(node: &mut Node, params: Option<&Value>) -> Response {
|
|||||||
None => return Response::error("missing 'npub' parameter"),
|
None => return Response::error("missing 'npub' parameter"),
|
||||||
};
|
};
|
||||||
|
|
||||||
info!(npub = %npub, "API disconnect requested");
|
debug!(npub = %npub, "API disconnect requested");
|
||||||
|
|
||||||
match node.api_disconnect(npub) {
|
match node.api_disconnect(npub) {
|
||||||
Ok(data) => Response::ok(data),
|
Ok(data) => Response::ok(data),
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ impl Node {
|
|||||||
|
|
||||||
let peer_count = peer_addrs.len();
|
let peer_count = peer_addrs.len();
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
request_id = request.request_id,
|
request_id = request.request_id,
|
||||||
target = %self.peer_display_name(target),
|
target = %self.peer_display_name(target),
|
||||||
ttl = ttl,
|
ttl = ttl,
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ impl Node {
|
|||||||
if let Some(peer) = self.peers.get_mut(&node_addr) {
|
if let Some(peer) = self.peers.get_mut(&node_addr) {
|
||||||
peer.set_handshake_msg2(wire_msg2.clone());
|
peer.set_handshake_msg2(wire_msg2.clone());
|
||||||
}
|
}
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&node_addr),
|
peer = %self.peer_display_name(&node_addr),
|
||||||
link_id = %link_id,
|
link_id = %link_id,
|
||||||
our_index = %our_index,
|
our_index = %our_index,
|
||||||
@@ -449,7 +449,7 @@ impl Node {
|
|||||||
}
|
}
|
||||||
// Clean up the losing connection's link
|
// Clean up the losing connection's link
|
||||||
self.remove_link(&loser_link_id);
|
self.remove_link(&loser_link_id);
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&node_addr),
|
peer = %self.peer_display_name(&node_addr),
|
||||||
loser_link_id = %loser_link_id,
|
loser_link_id = %loser_link_id,
|
||||||
"Inbound cross-connection won, loser link cleaned up"
|
"Inbound cross-connection won, loser link cleaned up"
|
||||||
@@ -474,7 +474,7 @@ impl Node {
|
|||||||
(packet.transport_id, packet.remote_addr.clone()),
|
(packet.transport_id, packet.remote_addr.clone()),
|
||||||
winner_link_id,
|
winner_link_id,
|
||||||
);
|
);
|
||||||
info!(
|
debug!(
|
||||||
winner_link_id = %winner_link_id,
|
winner_link_id = %winner_link_id,
|
||||||
"Inbound cross-connection lost, keeping existing"
|
"Inbound cross-connection lost, keeping existing"
|
||||||
);
|
);
|
||||||
@@ -640,7 +640,7 @@ impl Node {
|
|||||||
|
|
||||||
let peer_node_addr = *peer_identity.node_addr();
|
let peer_node_addr = *peer_identity.node_addr();
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&peer_node_addr),
|
peer = %self.peer_display_name(&peer_node_addr),
|
||||||
link_id = %link_id,
|
link_id = %link_id,
|
||||||
their_index = %header.sender_idx,
|
their_index = %header.sender_idx,
|
||||||
@@ -716,7 +716,7 @@ impl Node {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&peer_node_addr),
|
peer = %self.peer_display_name(&peer_node_addr),
|
||||||
new_our_index = %outbound_our_index,
|
new_our_index = %outbound_our_index,
|
||||||
new_their_index = %header.sender_idx,
|
new_their_index = %header.sender_idx,
|
||||||
@@ -736,7 +736,7 @@ impl Node {
|
|||||||
let outbound_our_index = conn.our_index();
|
let outbound_our_index = conn.our_index();
|
||||||
|
|
||||||
if let Some(peer) = self.peers.get(&peer_node_addr) {
|
if let Some(peer) = self.peers.get(&peer_node_addr) {
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&peer_node_addr),
|
peer = %self.peer_display_name(&peer_node_addr),
|
||||||
kept_their_index = ?peer.their_index(),
|
kept_their_index = ?peer.their_index(),
|
||||||
"Cross-connection: keeping inbound session and original their_index (peer outbound wins)"
|
"Cross-connection: keeping inbound session and original their_index (peer outbound wins)"
|
||||||
@@ -807,7 +807,7 @@ impl Node {
|
|||||||
(packet.transport_id, packet.remote_addr.clone()),
|
(packet.transport_id, packet.remote_addr.clone()),
|
||||||
link_id,
|
link_id,
|
||||||
);
|
);
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&node_addr),
|
peer = %self.peer_display_name(&node_addr),
|
||||||
loser_link_id = %loser_link_id,
|
loser_link_id = %loser_link_id,
|
||||||
"Outbound cross-connection won, loser link cleaned up"
|
"Outbound cross-connection won, loser link cleaned up"
|
||||||
@@ -832,7 +832,7 @@ impl Node {
|
|||||||
(packet.transport_id, packet.remote_addr.clone()),
|
(packet.transport_id, packet.remote_addr.clone()),
|
||||||
winner_link_id,
|
winner_link_id,
|
||||||
);
|
);
|
||||||
info!(
|
debug!(
|
||||||
winner_link_id = %winner_link_id,
|
winner_link_id = %winner_link_id,
|
||||||
"Outbound cross-connection lost, keeping existing"
|
"Outbound cross-connection lost, keeping existing"
|
||||||
);
|
);
|
||||||
@@ -950,7 +950,7 @@ impl Node {
|
|||||||
self.retry_pending.remove(&peer_node_addr);
|
self.retry_pending.remove(&peer_node_addr);
|
||||||
self.register_identity(peer_node_addr, verified_identity.pubkey_full());
|
self.register_identity(peer_node_addr, verified_identity.pubkey_full());
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&peer_node_addr),
|
peer = %self.peer_display_name(&peer_node_addr),
|
||||||
winner_link = %link_id,
|
winner_link = %link_id,
|
||||||
loser_link = %loser_link_id,
|
loser_link = %loser_link_id,
|
||||||
@@ -966,7 +966,7 @@ impl Node {
|
|||||||
// Free the index we allocated
|
// Free the index we allocated
|
||||||
let _ = self.index_allocator.free(our_index);
|
let _ = self.index_allocator.free(our_index);
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&peer_node_addr),
|
peer = %self.peer_display_name(&peer_node_addr),
|
||||||
winner_link = %existing_link_id,
|
winner_link = %existing_link_id,
|
||||||
loser_link = %link_id,
|
loser_link = %link_id,
|
||||||
|
|||||||
@@ -242,7 +242,7 @@ impl Node {
|
|||||||
};
|
};
|
||||||
let jitter_ms = mmp.receiver.jitter_us() as f64 / 1000.0;
|
let jitter_ms = mmp.receiver.jitter_us() as f64 / 1000.0;
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
peer = %peer_name,
|
peer = %peer_name,
|
||||||
rtt = %rtt_str,
|
rtt = %rtt_str,
|
||||||
loss = %loss_str,
|
loss = %loss_str,
|
||||||
@@ -265,7 +265,7 @@ impl Node {
|
|||||||
};
|
};
|
||||||
let loss_str = format!("{:.1}%", m.loss_rate() * 100.0);
|
let loss_str = format!("{:.1}%", m.loss_rate() * 100.0);
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
peer = %peer_name,
|
peer = %peer_name,
|
||||||
rtt = %rtt_str,
|
rtt = %rtt_str,
|
||||||
loss = %loss_str,
|
loss = %loss_str,
|
||||||
@@ -434,7 +434,7 @@ impl Node {
|
|||||||
};
|
};
|
||||||
let jitter_ms = mmp.receiver.jitter_us() as f64 / 1000.0;
|
let jitter_ms = mmp.receiver.jitter_us() as f64 / 1000.0;
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
session = %session_name,
|
session = %session_name,
|
||||||
rtt = %rtt_str,
|
rtt = %rtt_str,
|
||||||
loss = %loss_str,
|
loss = %loss_str,
|
||||||
@@ -458,7 +458,7 @@ impl Node {
|
|||||||
};
|
};
|
||||||
let loss_str = format!("{:.1}%", m.loss_rate() * 100.0);
|
let loss_str = format!("{:.1}%", m.loss_rate() * 100.0);
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
session = %session_name,
|
session = %session_name,
|
||||||
rtt = %rtt_str,
|
rtt = %rtt_str,
|
||||||
loss = %loss_str,
|
loss = %loss_str,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use crate::node::wire::build_msg1;
|
|||||||
use crate::noise::HandshakeState;
|
use crate::noise::HandshakeState;
|
||||||
use crate::protocol::{SessionDatagram, SessionSetup};
|
use crate::protocol::{SessionDatagram, SessionSetup};
|
||||||
use crate::NodeAddr;
|
use crate::NodeAddr;
|
||||||
use tracing::{debug, info, trace, warn};
|
use tracing::{debug, trace, warn};
|
||||||
|
|
||||||
/// Keep previous session alive for this long after cutover.
|
/// Keep previous session alive for this long after cutover.
|
||||||
const DRAIN_WINDOW_SECS: u64 = 10;
|
const DRAIN_WINDOW_SECS: u64 = 10;
|
||||||
@@ -93,7 +93,7 @@ impl Node {
|
|||||||
),
|
),
|
||||||
"peers_by_index should contain pre-registered new index after cutover"
|
"peers_by_index should contain pre-registered new index after cutover"
|
||||||
);
|
);
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&node_addr),
|
peer = %self.peer_display_name(&node_addr),
|
||||||
"Rekey cutover complete (initiator), K-bit flipped"
|
"Rekey cutover complete (initiator), K-bit flipped"
|
||||||
);
|
);
|
||||||
@@ -329,7 +329,7 @@ impl Node {
|
|||||||
if let Some(entry) = self.sessions.get_mut(&node_addr)
|
if let Some(entry) = self.sessions.get_mut(&node_addr)
|
||||||
&& entry.cutover_to_new_session(now_ms)
|
&& entry.cutover_to_new_session(now_ms)
|
||||||
{
|
{
|
||||||
info!(
|
debug!(
|
||||||
peer = %self.peer_display_name(&node_addr),
|
peer = %self.peer_display_name(&node_addr),
|
||||||
"FSP rekey cutover complete (initiator), K-bit flipped"
|
"FSP rekey cutover complete (initiator), K-bit flipped"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1169,7 +1169,7 @@ impl Node {
|
|||||||
entry.set_handshake_payload(setup_payload, now_ms + resend_interval);
|
entry.set_handshake_payload(setup_payload, now_ms + resend_interval);
|
||||||
self.sessions.insert(dest_addr, entry);
|
self.sessions.insert(dest_addr, entry);
|
||||||
|
|
||||||
info!(dest = %self.peer_display_name(&dest_addr), "Session initiation started");
|
debug!(dest = %self.peer_display_name(&dest_addr), "Session initiation started");
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,13 +33,13 @@ impl Node {
|
|||||||
let direction = conn.direction();
|
let direction = conn.direction();
|
||||||
let idle_ms = conn.idle_time(now_ms);
|
let idle_ms = conn.idle_time(now_ms);
|
||||||
if conn.is_failed() {
|
if conn.is_failed() {
|
||||||
info!(
|
debug!(
|
||||||
link_id = %link_id,
|
link_id = %link_id,
|
||||||
direction = %direction,
|
direction = %direction,
|
||||||
"Failed handshake connection cleaned up"
|
"Failed handshake connection cleaned up"
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
info!(
|
debug!(
|
||||||
link_id = %link_id,
|
link_id = %link_id,
|
||||||
direction = %direction,
|
direction = %direction,
|
||||||
idle_secs = idle_ms / 1000,
|
idle_secs = idle_ms / 1000,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ impl Node {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
info!(count = peer_configs.len(), "Initiating static peer connections");
|
debug!(count = peer_configs.len(), "Initiating static peer connections");
|
||||||
|
|
||||||
for peer_config in peer_configs {
|
for peer_config in peer_configs {
|
||||||
if let Err(e) = self.initiate_peer_connection(&peer_config).await {
|
if let Err(e) = self.initiate_peer_connection(&peer_config).await {
|
||||||
@@ -561,7 +561,7 @@ impl Node {
|
|||||||
let max_mss = effective_mtu.saturating_sub(40).saturating_sub(20); // IPv6 + TCP headers
|
let max_mss = effective_mtu.saturating_sub(40).saturating_sub(20); // IPv6 + TCP headers
|
||||||
|
|
||||||
info!("effective MTU: {} bytes", effective_mtu);
|
info!("effective MTU: {} bytes", effective_mtu);
|
||||||
info!(" max TCP MSS: {} bytes", max_mss);
|
debug!(" max TCP MSS: {} bytes", max_mss);
|
||||||
|
|
||||||
// Create writer (dups the fd for independent write access)
|
// Create writer (dups the fd for independent write access)
|
||||||
let (writer, tun_tx) = device.create_writer(max_mss)?;
|
let (writer, tun_tx) = device.create_writer(max_mss)?;
|
||||||
|
|||||||
+1
-1
@@ -990,7 +990,7 @@ impl Node {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
if should_log {
|
if should_log {
|
||||||
tracing::info!(
|
tracing::debug!(
|
||||||
estimated_mesh_size = size,
|
estimated_mesh_size = size,
|
||||||
peers = self.peers.len(),
|
peers = self.peers.len(),
|
||||||
children = child_count,
|
children = child_count,
|
||||||
|
|||||||
+2
-2
@@ -171,7 +171,7 @@ impl Node {
|
|||||||
state.retry_count += 1;
|
state.retry_count += 1;
|
||||||
let delay = state.backoff_ms(base_interval_ms, max_backoff_ms);
|
let delay = state.backoff_ms(base_interval_ms, max_backoff_ms);
|
||||||
state.retry_after_ms = now_ms + delay;
|
state.retry_after_ms = now_ms + delay;
|
||||||
info!(
|
debug!(
|
||||||
peer = %peer_name,
|
peer = %peer_name,
|
||||||
retry = state.retry_count,
|
retry = state.retry_count,
|
||||||
delay_secs = delay / 1000,
|
delay_secs = delay / 1000,
|
||||||
@@ -185,7 +185,7 @@ impl Node {
|
|||||||
let delay = state.backoff_ms(base_interval_ms, max_backoff_ms);
|
let delay = state.backoff_ms(base_interval_ms, max_backoff_ms);
|
||||||
state.retry_after_ms = now_ms + delay;
|
state.retry_after_ms = now_ms + delay;
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
peer = %peer_name,
|
peer = %peer_name,
|
||||||
delay_secs = delay / 1000,
|
delay_secs = delay / 1000,
|
||||||
"Scheduling auto-reconnect after link-dead removal"
|
"Scheduling auto-reconnect after link-dead removal"
|
||||||
|
|||||||
+1
-1
@@ -198,7 +198,7 @@ impl Node {
|
|||||||
|
|
||||||
self.stats_mut().tree.accepted += 1;
|
self.stats_mut().tree.accepted += 1;
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
from = %self.peer_display_name(from),
|
from = %self.peer_display_name(from),
|
||||||
seq = announce.declaration.sequence(),
|
seq = announce.declaration.sequence(),
|
||||||
depth = announce.ancestry.depth(),
|
depth = announce.ancestry.depth(),
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ async fn ethernet_receive_loop(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if packet_tx.send(packet).await.is_err() {
|
if packet_tx.send(packet).await.is_err() {
|
||||||
info!(
|
debug!(
|
||||||
transport_id = %transport_id,
|
transport_id = %transport_id,
|
||||||
"Packet channel closed, stopping receive loop"
|
"Packet channel closed, stopping receive loop"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -893,7 +893,7 @@ async fn tcp_receive_loop(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if packet_tx.send(packet).await.is_err() {
|
if packet_tx.send(packet).await.is_err() {
|
||||||
info!(
|
debug!(
|
||||||
transport_id = %transport_id,
|
transport_id = %transport_id,
|
||||||
"Packet channel closed, stopping TCP receive loop"
|
"Packet channel closed, stopping TCP receive loop"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -716,7 +716,7 @@ impl TorTransport {
|
|||||||
let proxy_addr = self.config.socks5_addr();
|
let proxy_addr = self.config.socks5_addr();
|
||||||
let timeout_ms = self.config.connect_timeout_ms();
|
let timeout_ms = self.config.connect_timeout_ms();
|
||||||
|
|
||||||
info!(
|
debug!(
|
||||||
transport_id = %self.transport_id,
|
transport_id = %self.transport_id,
|
||||||
remote_addr = %addr,
|
remote_addr = %addr,
|
||||||
proxy = %proxy_addr,
|
proxy = %proxy_addr,
|
||||||
@@ -1154,7 +1154,7 @@ async fn tor_receive_loop(
|
|||||||
let packet = ReceivedPacket::new(transport_id, remote_addr.clone(), data);
|
let packet = ReceivedPacket::new(transport_id, remote_addr.clone(), data);
|
||||||
|
|
||||||
if packet_tx.send(packet).await.is_err() {
|
if packet_tx.send(packet).await.is_err() {
|
||||||
info!(
|
debug!(
|
||||||
transport_id = %transport_id,
|
transport_id = %transport_id,
|
||||||
"Packet channel closed, stopping Tor receive loop"
|
"Packet channel closed, stopping Tor receive loop"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ async fn udp_receive_loop(
|
|||||||
|
|
||||||
if packet_tx.send(packet).await.is_err() {
|
if packet_tx.send(packet).await.is_err() {
|
||||||
// Receiver dropped, exit loop
|
// Receiver dropped, exit loop
|
||||||
info!(
|
debug!(
|
||||||
transport_id = %transport_id,
|
transport_id = %transport_id,
|
||||||
"Packet channel closed, stopping receive loop"
|
"Packet channel closed, stopping receive loop"
|
||||||
);
|
);
|
||||||
|
|||||||
+5
-5
@@ -13,7 +13,7 @@ use std::net::Ipv6Addr;
|
|||||||
use std::os::unix::io::{AsRawFd, FromRawFd};
|
use std::os::unix::io::{AsRawFd, FromRawFd};
|
||||||
use std::sync::mpsc;
|
use std::sync::mpsc;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tracing::{debug, error, info, trace};
|
use tracing::{debug, error, trace};
|
||||||
use tun::Layer;
|
use tun::Layer;
|
||||||
|
|
||||||
/// Channel sender for packets to be written to TUN.
|
/// Channel sender for packets to be written to TUN.
|
||||||
@@ -96,7 +96,7 @@ impl TunDevice {
|
|||||||
|
|
||||||
// Delete existing interface if present (TUN devices are exclusive)
|
// Delete existing interface if present (TUN devices are exclusive)
|
||||||
if interface_exists(name).await {
|
if interface_exists(name).await {
|
||||||
info!(name, "Deleting existing TUN interface");
|
debug!(name, "Deleting existing TUN interface");
|
||||||
if let Err(e) = delete_interface(name).await {
|
if let Err(e) = delete_interface(name).await {
|
||||||
debug!(name, error = %e, "Failed to delete existing interface");
|
debug!(name, error = %e, "Failed to delete existing interface");
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ impl TunDevice {
|
|||||||
///
|
///
|
||||||
/// This deletes the interface entirely.
|
/// This deletes the interface entirely.
|
||||||
pub async fn shutdown(&self) -> Result<(), TunError> {
|
pub async fn shutdown(&self) -> Result<(), TunError> {
|
||||||
info!(name = %self.name, "Deleting TUN device");
|
debug!(name = %self.name, "Deleting TUN device");
|
||||||
delete_interface(&self.name).await
|
delete_interface(&self.name).await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,9 +387,9 @@ pub fn log_ipv6_packet(packet: &[u8]) {
|
|||||||
/// to return an error. Use this for graceful shutdown when the TUN device
|
/// to return an error. Use this for graceful shutdown when the TUN device
|
||||||
/// has been moved to another thread.
|
/// has been moved to another thread.
|
||||||
pub async fn shutdown_tun_interface(name: &str) -> Result<(), TunError> {
|
pub async fn shutdown_tun_interface(name: &str) -> Result<(), TunError> {
|
||||||
info!("Shutting down TUN interface {}", name);
|
debug!("Shutting down TUN interface {}", name);
|
||||||
delete_interface(name).await?;
|
delete_interface(name).await?;
|
||||||
info!("TUN interface {} stopped", name);
|
debug!("TUN interface {} stopped", name);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user