Skip to content

Commit

Permalink
[NET_SCHED]: act_api: fix netlink API conversion bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jan 28, 2008
1 parent b03f467 commit 6d834e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/sched/act_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 6d834e0

Please sign in to comment.