@@ -10,8 +10,9 @@ import (
10
10
11
11
const (
12
12
tcRootQDisc = `dev %s handle 10: root`
13
+ tcRootExtra = `default 1`
13
14
tcDefaultClass = `dev %s parent 10: classid 10:1`
14
- tcTargetClass = `dev %s parent 10:1 classid 10:10`
15
+ tcTargetClass = `dev %s parent 10: classid 10:10`
15
16
tcNetemRule = `dev %s parent 10:10 handle 100:`
16
17
tcRate = `rate %vkbit`
17
18
tcDelay = `delay %vms`
@@ -66,7 +67,7 @@ func (t *tcThrottler) setup(cfg *Config) error {
66
67
func addRootQDisc (cfg * Config , c commander ) error {
67
68
//Add the root QDisc
68
69
root := fmt .Sprintf (tcRootQDisc , cfg .Device )
69
- strs := []string {tcAddQDisc , root , "htb" }
70
+ strs := []string {tcAddQDisc , root , "htb" , tcRootExtra }
70
71
cmd := strings .Join (strs , " " )
71
72
72
73
return c .execute (cmd )
@@ -94,8 +95,8 @@ func addTargetClass(cfg *Config, c commander) error {
94
95
tar := fmt .Sprintf (tcTargetClass , cfg .Device )
95
96
rate := ""
96
97
97
- if cfg .DefaultBandwidth > - 1 {
98
- rate = fmt .Sprintf (tcRate , cfg .DefaultBandwidth )
98
+ if cfg .TargetBandwidth > - 1 {
99
+ rate = fmt .Sprintf (tcRate , cfg .TargetBandwidth )
99
100
} else {
100
101
rate = fmt .Sprintf (tcRate , 1000000 )
101
102
}
0 commit comments