[NET_SCHED]: act_api: fix netlink API conversion bug
authorPatrick McHardy <kaber@trash.net>
Thu, 24 Jan 2008 04:32:42 +0000 (20:32 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:11:15 +0000 (15:11 -0800)
Fix two invalid attribute accesses, indices start at 1 with the new
netlink API.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_api.c

index ebd21d2..ae077ed 100644 (file)
@@ -997,11 +997,11 @@ find_dump_kind(struct nlmsghdr *n)
        if (nla_parse(tb, TCA_ACT_MAX_PRIO, nla_data(tb1),
                      NLMSG_ALIGN(nla_len(tb1)), NULL) < 0)
                return NULL;
-       if (tb[0] == NULL)
-               return NULL;
 
-       if (nla_parse(tb2, TCA_ACT_MAX, nla_data(tb[0]),
-                     nla_len(tb[0]), NULL) < 0)
+       if (tb[1] == NULL)
+               return NULL;
+       if (nla_parse(tb2, TCA_ACT_MAX, nla_data(tb[1]),
+                     nla_len(tb[1]), NULL) < 0)
                return NULL;
        kind = tb2[TCA_ACT_KIND];