Skip to content

Commit

Permalink
Fix: Do not crash when enumerating tc filters with unknown actionType
Browse files Browse the repository at this point in the history
for example actionType "vlan"

#987
  • Loading branch information
Matus Petrulak authored and aboch committed Sep 4, 2024
1 parent 9264582 commit 0cd1f79
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions filter_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 0cd1f79

Please sign in to comment.