Fix: Do not crash when enumerating tc filters with unknown actionType

for example actionType "vlan"

#987
This commit is contained in:
Matus Petrulak
2024-09-04 23:37:12 +02:00
committed by Alessandro Boch
parent 92645823f3
commit 0cd1f7961c

View File

@@ -920,9 +920,11 @@ func parseActions(tables []syscall.NetlinkRouteAttr) ([]Action, error) {
actionnStatistic = (*ActionStatistic)(s)
}
}
action.Attrs().Statistics = actionnStatistic
action.Attrs().Timestamp = actionTimestamp
actions = append(actions, action)
if action != nil {
action.Attrs().Statistics = actionnStatistic
action.Attrs().Timestamp = actionTimestamp
actions = append(actions, action)
}
}
return actions, nil
}