Skip to content

Commit 0cd1f79

Browse files
Matus Petrulakaboch
authored andcommitted
Fix: Do not crash when enumerating tc filters with unknown actionType
for example actionType "vlan" #987
1 parent 9264582 commit 0cd1f79

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

filter_linux.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -920,9 +920,11 @@ func parseActions(tables []syscall.NetlinkRouteAttr) ([]Action, error) {
920920
actionnStatistic = (*ActionStatistic)(s)
921921
}
922922
}
923-
action.Attrs().Statistics = actionnStatistic
924-
action.Attrs().Timestamp = actionTimestamp
925-
actions = append(actions, action)
923+
if action != nil {
924+
action.Attrs().Statistics = actionnStatistic
925+
action.Attrs().Timestamp = actionTimestamp
926+
actions = append(actions, action)
927+
}
926928
}
927929
return actions, nil
928930
}

0 commit comments

Comments
 (0)