Skip to content

Commit

Permalink
fix return
Browse files Browse the repository at this point in the history
  • Loading branch information
vaporeyes committed Aug 29, 2019
1 parent 27ba98c commit 2744123
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions throttler/ipfw.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func (i *ipfwThrottler) check() string {
func (i *ipfwThrottler) buildConfigCommand(c *Config) string {
cmd := ipfwConfig

if c.Latency > 0 {
cmd = cmd + " delay " + strconv.Itoa(c.Latency) + "ms"
if c.Delay > 0 {
cmd = cmd + " delay " + strconv.Itoa(c.Delay) + "ms"
}

if c.TargetBandwidth > 0 {
Expand Down
4 changes: 2 additions & 2 deletions throttler/pfctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ func (i *pfctlThrottler) buildConfigCommand(c *Config) []string {
cmd := dnctl

// Add all non tcp version dependent stuff first...
if c.Latency > 0 {
cmd = cmd + " delay " + strconv.Itoa(c.Latency) + "ms"
if c.Delay > 0 {
cmd = cmd + " delay " + strconv.Itoa(c.Delay) + "ms"
}

if c.TargetBandwidth > 0 {
Expand Down
2 changes: 1 addition & 1 deletion throttler/tc.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ func (t *tcThrottler) teardown(cfg *Config) error {
if err := delRootQDisc(cfg, t.c); err != nil {
return err
}
return nil

if err := delIptablesRules(cfg, t.c); err != nil {
return err
}
return nil
}

func delIptablesRules(cfg *Config, c commander) error {
Expand Down

0 comments on commit 2744123

Please sign in to comment.