Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
88c5c1d2
Commit
88c5c1d2
authored
Oct 06, 2002
by
Martin Devera
Committed by
David S. Miller
Oct 06, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/sched/sch_htb.c: Check that node is really leaf before modifying cl->un.leaf
parent
7d8f0e46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
net/sched/sch_htb.c
net/sched/sch_htb.c
+20
-14
No files found.
net/sched/sch_htb.c
View file @
88c5c1d2
...
...
@@ -15,9 +15,11 @@
* helped a lot to locate nasty class stall bug
* Andi Kleen, Jamal Hadi, Bert Hubert
* code review and helpful comments on shaping
* Tomasz Wrona, <tw@eter.tym.pl>
* created test case so that I was able to fix nasty bug
* and many others. thanks.
*
* $Id: sch_htb.c,v 1.1
3 2002/05/25 09:04:50 devik Exp
$
* $Id: sch_htb.c,v 1.1
4 2002/09/28 12:55:22 devik Exp devik
$
*/
#include <linux/config.h>
#include <linux/module.h>
...
...
@@ -69,7 +71,7 @@
#define HTB_HYSTERESIS 1
/* whether to use mode hysteresis for speedup */
#define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
#define HTB_QUNLOCK(S) spin_unlock_bh(&(S)->dev->queue_lock)
#define HTB_VER 0x3000
6
/* major must be matched with number suplied by TC as version */
#define HTB_VER 0x3000
7
/* major must be matched with number suplied by TC as version */
#if HTB_VER >> 16 != TC_HTB_PROTOVER
#error "Mismatched sch_htb.c and pkt_sch.h"
...
...
@@ -1496,19 +1498,23 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
#endif
}
else
sch_tree_lock
(
sch
);
cl
->
un
.
leaf
.
quantum
=
rtab
->
rate
.
rate
/
q
->
rate2quantum
;
if
(
!
hopt
->
quantum
&&
cl
->
un
.
leaf
.
quantum
<
1000
)
{
printk
(
KERN_WARNING
"HTB: quantum of class %X is small. Consider r2q change."
,
cl
->
classid
);
cl
->
un
.
leaf
.
quantum
=
1000
;
}
if
(
!
hopt
->
quantum
&&
cl
->
un
.
leaf
.
quantum
>
200000
)
{
printk
(
KERN_WARNING
"HTB: quantum of class %X is big. Consider r2q change."
,
cl
->
classid
);
cl
->
un
.
leaf
.
quantum
=
200000
;
/* it used to be a nasty bug here, we have to check that node
is really leaf before changing cl->un.leaf ! */
if
(
!
cl
->
level
)
{
cl
->
un
.
leaf
.
quantum
=
rtab
->
rate
.
rate
/
q
->
rate2quantum
;
if
(
!
hopt
->
quantum
&&
cl
->
un
.
leaf
.
quantum
<
1000
)
{
printk
(
KERN_WARNING
"HTB: quantum of class %X is small. Consider r2q change."
,
cl
->
classid
);
cl
->
un
.
leaf
.
quantum
=
1000
;
}
if
(
!
hopt
->
quantum
&&
cl
->
un
.
leaf
.
quantum
>
200000
)
{
printk
(
KERN_WARNING
"HTB: quantum of class %X is big. Consider r2q change."
,
cl
->
classid
);
cl
->
un
.
leaf
.
quantum
=
200000
;
}
if
(
hopt
->
quantum
)
cl
->
un
.
leaf
.
quantum
=
hopt
->
quantum
;
if
((
cl
->
un
.
leaf
.
prio
=
hopt
->
prio
)
>=
TC_HTB_NUMPRIO
)
cl
->
un
.
leaf
.
prio
=
TC_HTB_NUMPRIO
-
1
;
}
if
(
hopt
->
quantum
)
cl
->
un
.
leaf
.
quantum
=
hopt
->
quantum
;
if
((
cl
->
un
.
leaf
.
prio
=
hopt
->
prio
)
>=
TC_HTB_NUMPRIO
)
cl
->
un
.
leaf
.
prio
=
TC_HTB_NUMPRIO
-
1
;
cl
->
buffer
=
hopt
->
buffer
;
cl
->
cbuffer
=
hopt
->
cbuffer
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment