Skip to content

Commit aa5af06

Browse files
committed
ipn/ipnlocal: include web client port in setTCPPortsIntercepted
Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
1 parent da31ce3 commit aa5af06

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ipn/ipnlocal/local.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4210,6 +4210,9 @@ func (b *LocalBackend) ResetForClientDisconnect() {
42104210

42114211
func (b *LocalBackend) ShouldRunSSH() bool { return b.sshAtomicBool.Load() && envknob.CanSSHD() }
42124212

4213+
// ShouldRunWebClient reports whether the web client is being run
4214+
// within this tailscaled instance. ShouldRunWebClient is safe to
4215+
// call regardless of whether b.mu is held or not.
42134216
func (b *LocalBackend) ShouldRunWebClient() bool { return b.webClientAtomicBool.Load() }
42144217

42154218
func (b *LocalBackend) setWebClientAtomicBoolLocked(nm *netmap.NetworkMap, prefs ipn.PrefsView) {
@@ -4467,6 +4470,9 @@ func (b *LocalBackend) setTCPPortsInterceptedFromNetmapAndPrefsLocked(prefs ipn.
44674470
if prefs.Valid() && prefs.RunSSH() && envknob.CanSSHD() {
44684471
handlePorts = append(handlePorts, 22)
44694472
}
4473+
if b.ShouldRunWebClient() {
4474+
handlePorts = append(handlePorts, 5252)
4475+
}
44704476

44714477
b.reloadServeConfigLocked(prefs)
44724478
if b.serveConfig.Valid() {

0 commit comments

Comments
 (0)