Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63409
b: refs/heads/master
c: ffc8fef
h: refs/heads/master
i:
  63407: f01ab21
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jul 31, 2007
1 parent f31589a commit 1c2dd04
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bdba91ec70fb5ccbdeb1c7068319adc6ea9e1a7d
refs/heads/master: ffc8fefaf289fa485bc5c33e71572e6ce559d569
17 changes: 12 additions & 5 deletions trunk/net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n)
return;
while ((parentid = sch->parent)) {
sch = qdisc_lookup(sch->dev, TC_H_MAJ(parentid));
if (sch == NULL) {
WARN_ON(parentid != TC_H_ROOT);
return;
}
cops = sch->ops->cl_ops;
if (cops->qlen_notify) {
cl = cops->get(sch, parentid);
Expand Down Expand Up @@ -420,8 +424,6 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
unsigned long cl = cops->get(parent, classid);
if (cl) {
err = cops->graft(parent, cl, new, old);
if (new)
new->parent = classid;
cops->put(parent, cl);
}
}
Expand All @@ -436,7 +438,8 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
*/

static struct Qdisc *
qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
qdisc_create(struct net_device *dev, u32 parent, u32 handle,
struct rtattr **tca, int *errp)
{
int err;
struct rtattr *kind = tca[TCA_KIND-1];
Expand Down Expand Up @@ -482,6 +485,8 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
goto err_out2;
}

sch->parent = parent;

if (handle == TC_H_INGRESS) {
sch->flags |= TCQ_F_INGRESS;
sch->stats_lock = &dev->ingress_lock;
Expand Down Expand Up @@ -758,9 +763,11 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
if (!(n->nlmsg_flags&NLM_F_CREATE))
return -ENOENT;
if (clid == TC_H_INGRESS)
q = qdisc_create(dev, tcm->tcm_parent, tca, &err);
q = qdisc_create(dev, tcm->tcm_parent, tcm->tcm_parent,
tca, &err);
else
q = qdisc_create(dev, tcm->tcm_handle, tca, &err);
q = qdisc_create(dev, tcm->tcm_parent, tcm->tcm_handle,
tca, &err);
if (q == NULL) {
if (err == -EAGAIN)
goto replay;
Expand Down

0 comments on commit 1c2dd04

Please sign in to comment.