aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-09-04 02:41:13 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-05 02:10:15 -0400
commitc9f1d0389b962521af1e2b699c8ee5e299d77b85 (patch)
treee317e8b012be8b31b303bdb3f6ee5e3929de0a7b /net/sched
parentb1f57195585e376d1944c32c046359640b06a669 (diff)
net_sched: fix class grafting errno codes
If the parent qdisc doesn't support classes, use EOPNOTSUPP. If the parent class doesn't exist, use ENOENT. Currently EINVAL is returned in both cases. Additionally check whether grafting is supported and remove a now unnecessary graft function from sch_ingress. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_api.c8
-rw-r--r--net/sched/sch_ingress.c7
2 files changed, 4 insertions, 11 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 24d17ce9c294..bef2d645a366 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -728,14 +728,14 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
728 } else { 728 } else {
729 const struct Qdisc_class_ops *cops = parent->ops->cl_ops; 729 const struct Qdisc_class_ops *cops = parent->ops->cl_ops;
730 730
731 err = -EINVAL; 731 err = -EOPNOTSUPP;
732 732 if (cops && cops->graft) {
733 if (cops) {
734 unsigned long cl = cops->get(parent, classid); 733 unsigned long cl = cops->get(parent, classid);
735 if (cl) { 734 if (cl) {
736 err = cops->graft(parent, cl, new, &old); 735 err = cops->graft(parent, cl, new, &old);
737 cops->put(parent, cl); 736 cops->put(parent, cl);
738 } 737 } else
738 err = -ENOENT;
739 } 739 }
740 if (!err) 740 if (!err)
741 notify_and_destroy(skb, n, classid, old, new); 741 notify_and_destroy(skb, n, classid, old, new);
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 4a2b77374358..ace7902b5097 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -22,12 +22,6 @@ struct ingress_qdisc_data {
22 22
23/* ------------------------- Class/flow operations ------------------------- */ 23/* ------------------------- Class/flow operations ------------------------- */
24 24
25static int ingress_graft(struct Qdisc *sch, unsigned long arg,
26 struct Qdisc *new, struct Qdisc **old)
27{
28 return -EOPNOTSUPP;
29}
30
31static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg) 25static struct Qdisc *ingress_leaf(struct Qdisc *sch, unsigned long arg)
32{ 26{
33 return NULL; 27 return NULL;
@@ -123,7 +117,6 @@ nla_put_failure:
123} 117}
124 118
125static const struct Qdisc_class_ops ingress_class_ops = { 119static const struct Qdisc_class_ops ingress_class_ops = {
126 .graft = ingress_graft,
127 .leaf = ingress_leaf, 120 .leaf = ingress_leaf,
128 .get = ingress_get, 121 .get = ingress_get,
129 .put = ingress_put, 122 .put = ingress_put,