Skip to content

Commit

Permalink
Merge pull request #5971 from mysteriumnetwork/fix/userspace-linux
Browse files Browse the repository at this point in the history
Don't use tc shaper on Linux if userspace mode is active
  • Loading branch information
Zensey authored Feb 15, 2024
2 parents e633182 + e45ac7e commit 063570e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion core/shaper/shaper_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@ type linuxShaper struct {
listenTopic string
}

func create(listener eventListener) *linuxShaper {
type linuxShaperNoop struct{}

func (s *linuxShaperNoop) Start(interfaceName string) error {
return nil
}

func (s *linuxShaperNoop) Clear(interfaceName string) {
return
}

func create(listener eventListener) Shaper {
// return a noop filter if userspace flag is set
if config.GetBool(config.FlagUserspace) {
return &linuxShaperNoop{}
}

ws := wondershaper.New()
ws.Stdout = log.Logger
ws.Stderr = log.Logger
Expand Down

0 comments on commit 063570e

Please sign in to comment.