Skip to content

Commit

Permalink
fix(linux/net): 🐛 only use link up/down/invalid netlink messages for …
Browse files Browse the repository at this point in the history
…link state
  • Loading branch information
joshuar committed Nov 12, 2024
1 parent 62a4a79 commit 27919b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/linux/net/linkSensors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 27919b4

Please sign in to comment.