Skip to content

Commit 75d4d35

Browse files
committed
Disable port list
1 parent c544091 commit 75d4d35

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

portlist/poller.go

+3-14
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ package portlist
99
import (
1010
"errors"
1111
"fmt"
12-
"runtime"
1312
"slices"
1413
"sync"
1514
"time"
16-
17-
"github.com/sagernet/tailscale/envknob"
1815
)
1916

2017
var (
21-
newOSImpl func(includeLocalhost bool) osImpl // if non-nil, constructs a new osImpl.
22-
pollInterval = 5 * time.Second // default; changed by some OS-specific init funcs
23-
debugDisablePortlist = envknob.RegisterBool("TS_DEBUG_DISABLE_PORTLIST")
18+
newOSImpl func(includeLocalhost bool) osImpl // if non-nil, constructs a new osImpl.
19+
pollInterval = 5 * time.Second // default; changed by some OS-specific init funcs
2420
)
2521

2622
// PollInterval is the recommended OS-specific interval
@@ -76,14 +72,7 @@ func (p *Poller) setPrev(pl List) {
7672
// init initializes the Poller by ensuring it has an underlying
7773
// OS implementation and is not turned off by envknob.
7874
func (p *Poller) init() {
79-
switch {
80-
case debugDisablePortlist():
81-
p.initErr = errors.New("portlist disabled by envknob")
82-
case newOSImpl == nil:
83-
p.initErr = errors.New("portlist poller not implemented on " + runtime.GOOS)
84-
default:
85-
p.os = newOSImpl(p.IncludeLocalhost)
86-
}
75+
p.initErr = errors.New("portlist disabled by sing-box")
8776
}
8877

8978
// Close closes the Poller.

0 commit comments

Comments
 (0)