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.
This commit is contained in:
Nils Andreas Svee committed 2026-08-07 16:05:00 +07:00
1 parent 7e0f434251
commit 605ec6ef81
1 file changed
+2 -18
+2 -18
View File
@@ -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 {