Skip to content

Commit

Permalink
act: fix the logic of parsing actions
Browse files Browse the repository at this point in the history
It is proved that actions are not always put from 0,
they could be discontinuous.

http://lists.infradead.org/pipermail/libnl/2014-April/001374.html

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
  • Loading branch information
congwang authored and thom311 committed Jun 10, 2014
1 parent 872544c commit 6608cd5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/route/act.c
Expand Up @@ -396,9 +396,12 @@ int rtnl_act_parse(struct rtnl_act **head, struct nlattr *tb)
if (err < 0)
return err;

for (i = 0; i < TCA_ACT_MAX_PRIO && nla[i]; i++) {
for (i = 0; i < TCA_ACT_MAX_PRIO; i++) {
struct rtnl_tc *tc;

if (nla[i] == NULL)
continue;

act = rtnl_act_alloc();
if (!act) {
err = -NLE_NOMEM;
Expand Down

0 comments on commit 6608cd5

Please sign in to comment.