From 605ec6ef815815716b8fcf8c642b9d98e651ea51 Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Fri, 7 Aug 2026 12:58:37 +0700 Subject: [PATCH] refactor(main): simplify interface stats direction logic Remove the ifb/veth interface prefix detection from interface_stats_directions. The function now unconditionally returns RX for download and TX for upload, as the previous heuristic was unreliable and the simplified behavior matches actual usage. --- src/main.rs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index 47b4a1f..a4449cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -155,24 +155,8 @@ fn install_signal_handlers() { } } -fn interface_stats_directions(settings: &Settings) -> (StatsDirection, StatsDirection) { - let download = if settings.network.download_interface.starts_with("ifb") - || settings.network.download_interface.starts_with("veth") - { - StatsDirection::TX - } else { - StatsDirection::RX - }; - - let upload = if settings.network.upload_interface.starts_with("ifb") - || settings.network.upload_interface.starts_with("veth") - { - StatsDirection::RX - } else { - StatsDirection::TX - }; - - (download, upload) +fn interface_stats_directions(_: &Settings) -> (StatsDirection, StatsDirection) { + (StatsDirection::RX, StatsDirection::TX) } fn probe_identifier() -> u16 {