diff options
author | Patrick McHardy <kaber@trash.net> | 2006-03-20 22:01:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 22:01:21 -0500 |
commit | 053cfed75d9e01bda274c5b0126f5937181dcb62 (patch) | |
tree | eddf99fddfdb6979c422c427a60a164135e0fc20 /net/sched/sch_tbf.c | |
parent | cdc7f8e362bcadbc312c97fb69d8d59676eec422 (diff) |
[PKT_SCHED]: Restore TBF change semantic
When TBF was converted to a classful qdisc, the semantic of the limit
parameter was broken. On initilization an inner bfifo qdisc is created
for backwards compatibility, when changing parameters however the new
limit is ignored and the current child qdisc remains in place.
Always replace the child qdisc by the default bfifo when limit is above
zero, otherwise don't touch the inner qdisc. Current tc version enforce
a limit above zero, other users can avoid creating the inner qdisc by
using zero.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_tbf.c')
-rw-r--r-- | net/sched/sch_tbf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index e9e473457361..d8e03c74ca76 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -341,13 +341,14 @@ static int tbf_change(struct Qdisc* sch, struct rtattr *opt) | |||
341 | if (max_size < 0) | 341 | if (max_size < 0) |
342 | goto done; | 342 | goto done; |
343 | 343 | ||
344 | if (q->qdisc == &noop_qdisc) { | 344 | if (qopt->limit > 0) { |
345 | if ((child = tbf_create_dflt_qdisc(sch->dev, qopt->limit)) == NULL) | 345 | if ((child = tbf_create_dflt_qdisc(sch->dev, qopt->limit)) == NULL) |
346 | goto done; | 346 | goto done; |
347 | } | 347 | } |
348 | 348 | ||
349 | sch_tree_lock(sch); | 349 | sch_tree_lock(sch); |
350 | if (child) q->qdisc = child; | 350 | if (child) |
351 | qdisc_destroy(xchg(&q->qdisc, child)); | ||
351 | q->limit = qopt->limit; | 352 | q->limit = qopt->limit; |
352 | q->mtu = qopt->mtu; | 353 | q->mtu = qopt->mtu; |
353 | q->max_size = max_size; | 354 | q->max_size = max_size; |