From 27919b46fbba0af2ba043a6ea694e84bbe00cdbb Mon Sep 17 00:00:00 2001 From: Joshua Rich Date: Tue, 12 Nov 2024 15:30:31 +1000 Subject: [PATCH] fix(linux/net): :bug: only use link up/down/invalid netlink messages for link state --- internal/linux/net/linkSensors.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/linux/net/linkSensors.go b/internal/linux/net/linkSensors.go index c74921000..b931e2bbf 100644 --- a/internal/linux/net/linkSensors.go +++ b/internal/linux/net/linkSensors.go @@ -56,9 +56,11 @@ func newLinkSensor(msg rtnetlink.LinkMessage) *sensor.Entity { case rtnetlink.OperStateNotPresent: link.Value = "invalid" link.Icon = "mdi:close-network" - default: + case rtnetlink.OperStateDown: link.Value = "down" link.Icon = "mdi:network-off" + default: + return nil } if msg.Attributes.Info != nil {