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>
This commit is contained in:

committed by
David S. Miller

parent
b1f5719558
commit
c9f1d0389b
@@ -728,14 +728,14 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
|
||||
} else {
|
||||
const struct Qdisc_class_ops *cops = parent->ops->cl_ops;
|
||||
|
||||
err = -EINVAL;
|
||||
|
||||
if (cops) {
|
||||
err = -EOPNOTSUPP;
|
||||
if (cops && cops->graft) {
|
||||
unsigned long cl = cops->get(parent, classid);
|
||||
if (cl) {
|
||||
err = cops->graft(parent, cl, new, &old);
|
||||
cops->put(parent, cl);
|
||||
}
|
||||
} else
|
||||
err = -ENOENT;
|
||||
}
|
||||
if (!err)
|
||||
notify_and_destroy(skb, n, classid, old, new);
|
||||
|
Reference in New Issue
Block a user