summaryrefslogtreecommitdiffstats
path: root/lib/route
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2014-04-15 01:39:08 (GMT)
committerThomas Haller <thaller@redhat.com>2014-06-10 17:09:00 (GMT)
commit6608cd5d7242a8b58e62208e71b6c276434566ec (patch)
treeceac6f5a83f2332e1a1b3464ba0ab103a36be17d /lib/route
parent872544c0c0283db1e048969d17982398aca6934b (diff)
downloadlibnl-6608cd5d7242a8b58e62208e71b6c276434566ec.zip
libnl-6608cd5d7242a8b58e62208e71b6c276434566ec.tar.gz
libnl-6608cd5d7242a8b58e62208e71b6c276434566ec.tar.bz2
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>
Diffstat (limited to 'lib/route')
-rw-r--r--lib/route/act.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/route/act.c b/lib/route/act.c
index 0e5d7d1..85ce445 100644
--- a/lib/route/act.c
+++ b/lib/route/act.c
@@ -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;