aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2006-07-05 20:58:51 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-07-24 20:35:22 -0700
commit07d1f3a0037a0e4b1b1aff13d97180189148f4f4 (patch)
tree4089ef3e335fc0a46e7d60e5c738af31f0bad0fd
parent0a5bad5657163f8f44f6220929a70acf297d3dd5 (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> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/sched/act_api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 67c31f90d56..eb7dc2947a0 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -251,15 +251,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,