From 5c6b11c794e808c120ec99cb7377989fb47c2567 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Wed, 26 Nov 2025 19:19:21 +0100 Subject: [PATCH] Filter out network interfaces without IP addresses Remove interfaces like ifb0, dummy devices that have no IPs. Only show interfaces with at least one IPv4 or IPv6 address. Version bump to 0.1.167 --- Cargo.lock | 6 +++--- agent/Cargo.toml | 2 +- agent/src/collectors/network.rs | 8 +++++++- dashboard/Cargo.toml | 2 +- shared/Cargo.toml | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c0d183..2eaf879 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.166" +version = "0.1.167" dependencies = [ "anyhow", "chrono", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.166" +version = "0.1.167" dependencies = [ "anyhow", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.166" +version = "0.1.167" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 30135f7..25d2afd 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.166" +version = "0.1.167" edition = "2021" [dependencies] diff --git a/agent/src/collectors/network.rs b/agent/src/collectors/network.rs index 3274ac8..1da0d01 100644 --- a/agent/src/collectors/network.rs +++ b/agent/src/collectors/network.rs @@ -90,6 +90,12 @@ impl NetworkCollector { } } + // Only add interfaces that have at least one IP address + // This filters out ifb*, dummy interfaces, etc. that have no IPs + if ipv4_addresses.is_empty() && ipv6_addresses.is_empty() { + continue; + } + // Determine if physical and get status let is_physical = Self::is_physical_interface(&name); let link_status = if is_physical { @@ -104,7 +110,7 @@ impl NetworkCollector { ipv6_addresses, is_physical, link_status, - parent_interface: None, // TODO: Implement virtual interface parent detection + parent_interface: None, }); } } diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 57a764c..e035d48 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.166" +version = "0.1.167" edition = "2021" [dependencies] diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 26b05e3..3af3a48 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.166" +version = "0.1.167" edition = "2021" [dependencies]