diff options
author | Thomas Graf <tgraf@suug.ch> | 2006-07-05 23:47:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-05 23:47:28 -0400 |
commit | 4fe683f50d3fc8e36d4749277631dfc711393aa0 (patch) | |
tree | 0843a4082dc39cb70f48f4c4691ff310fd1bc39e /net/sched/act_api.c | |
parent | d152b4e1e9a18f332ecd9e66492d706edc083345 (diff) |
[PKT_SCHED]: Fix error handling while dumping actions
"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>
Diffstat (limited to 'net/sched/act_api.c')
-rw-r--r-- | net/sched/act_api.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 9b2e3975be0b..599423cc9d0d 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
@@ -250,15 +250,17 @@ tcf_action_dump(struct sk_buff *skb, struct tc_action *act, int bind, int ref) | |||
250 | RTA_PUT(skb, a->order, 0, NULL); | 250 | RTA_PUT(skb, a->order, 0, NULL); |
251 | err = tcf_action_dump_1(skb, a, bind, ref); | 251 | err = tcf_action_dump_1(skb, a, bind, ref); |
252 | if (err < 0) | 252 | if (err < 0) |
253 | goto rtattr_failure; | 253 | goto errout; |
254 | r->rta_len = skb->tail - (u8*)r; | 254 | r->rta_len = skb->tail - (u8*)r; |
255 | } | 255 | } |
256 | 256 | ||
257 | return 0; | 257 | return 0; |
258 | 258 | ||
259 | rtattr_failure: | 259 | rtattr_failure: |
260 | err = -EINVAL; | ||
261 | errout: | ||
260 | skb_trim(skb, b - skb->data); | 262 | skb_trim(skb, b - skb->data); |
261 | return -err; | 263 | return err; |
262 | } | 264 | } |
263 | 265 | ||
264 | struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, | 266 | struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, |