From 0cd1f7961c6b1ee2e64a13a5916aa03c6017eaf6 Mon Sep 17 00:00:00 2001 From: Matus Petrulak Date: Wed, 4 Sep 2024 23:37:12 +0200 Subject: [PATCH] Fix: Do not crash when enumerating tc filters with unknown actionType for example actionType "vlan" #987 --- filter_linux.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/filter_linux.go b/filter_linux.go index 87cd18f..cf6bd5f 100644 --- a/filter_linux.go +++ b/filter_linux.go @@ -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 }