From d1e1c025b0b37521cb10bfb5a83af6f5e3682550 Mon Sep 17 00:00:00 2001 From: shayne Date: Sun, 20 Nov 2022 13:22:54 -0500 Subject: [PATCH] tailcfg: add TailscaleFunnelEnabled to HostInfo (#6414) Adding this convenience for tailscale/corp#8015 and to avoid leaking WireIngress. Signed-off-by: Shayne Sweeney --- tailcfg/tailcfg.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index 36fba7d05..d6ff5372d 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -541,6 +541,14 @@ func (hi *Hostinfo) TailscaleSSHEnabled() bool { func (v HostinfoView) TailscaleSSHEnabled() bool { return v.ж.TailscaleSSHEnabled() } +// TailscaleFunnelEnabled reports whether or not this node has explicitly +// enabled Funnel. +func (hi *Hostinfo) TailscaleFunnelEnabled() bool { + return hi != nil && hi.WireIngress +} + +func (v HostinfoView) TailscaleFunnelEnabled() bool { return v.ж.TailscaleFunnelEnabled() } + // NetInfo contains information about the host's network state. type NetInfo struct { // MappingVariesByDestIP says whether the host's NAT mappings