Filter out network interfaces without IP addresses
All checks were successful
Build and Release / build-and-release (push) Successful in 1m9s

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
This commit is contained in:
2025-11-26 19:19:21 +01:00
parent 9f0aa5f806
commit 5c6b11c794
5 changed files with 13 additions and 7 deletions

View File

@@ -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,
});
}
}