Skip to content

Commit

Permalink
[PKT_SCHED]: Fix error handling while dumping actions
Browse files Browse the repository at this point in the history
"return -err" and blindly inheriting the error code in the netlink
failure exception handler causes errors codes to be returned as
positive value therefore making them being ignored by the caller.

May lead to sending out incomplete netlink messages.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Jul 6, 2006
1 parent d152b4e commit 4fe683f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/sched/act_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,17 @@ tcf_action_dump(struct sk_buff *skb, struct tc_action *act, int bind, int ref)
RTA_PUT(skb, a->order, 0, NULL);
err = tcf_action_dump_1(skb, a, bind, ref);
if (err < 0)
goto rtattr_failure;
goto errout;
r->rta_len = skb->tail - (u8*)r;
}

return 0;

rtattr_failure:
err = -EINVAL;
errout:
skb_trim(skb, b - skb->data);
return -err;
return err;
}

struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
Expand Down

0 comments on commit 4fe683f

Please sign in to comment.