act: fix the logic of parsing actions
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>
This commit is contained in:
parent
872544c0c0
commit
6608cd5d72
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue