ipn/ipnlocal,tailcfg: don't send WireIngress if IngressEnabled already true (#14960)

Hostinfo.WireIngress is used as a hint that the node intends to use
funnel. We now send another field, IngressEnabled, in cases where
funnel is explicitly enabled, and the logic control-side has
been changed to look at IngressEnabled as well as WireIngress in all
cases where previously the hint was used - so we can now stop sending
WireIngress when IngressEnabled is true to save some bandwidth.

Updates tailscale/tailscale#11572
Updates tailscale/corp#25931

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
Irbe Krumina
2025-02-16 09:38:02 +00:00
committed by GitHub
parent 606f7ef2c6
commit b21eec7621
3 changed files with 40 additions and 31 deletions

View File

@@ -5084,7 +5084,7 @@ func TestUpdateIngressLocked(t *testing.T) {
},
},
wantIngress: true,
wantWireIngress: true,
wantWireIngress: false, // implied by wantIngress
wantControlUpdate: true,
},
{
@@ -5111,7 +5111,6 @@ func TestUpdateIngressLocked(t *testing.T) {
name: "funnel_enabled_no_change",
hi: &tailcfg.Hostinfo{
IngressEnabled: true,
WireIngress: true,
},
sc: &ipn.ServeConfig{
AllowFunnel: map[ipn.HostPort]bool{
@@ -5119,7 +5118,7 @@ func TestUpdateIngressLocked(t *testing.T) {
},
},
wantIngress: true,
wantWireIngress: true,
wantWireIngress: false, // implied by wantIngress
},
{
name: "funnel_disabled_no_change",
@@ -5137,7 +5136,6 @@ func TestUpdateIngressLocked(t *testing.T) {
name: "funnel_changes_to_disabled",
hi: &tailcfg.Hostinfo{
IngressEnabled: true,
WireIngress: true,
},
sc: &ipn.ServeConfig{
AllowFunnel: map[ipn.HostPort]bool{
@@ -5157,8 +5155,8 @@ func TestUpdateIngressLocked(t *testing.T) {
"tailnet.xyz:443": true,
},
},
wantWireIngress: true,
wantIngress: true,
wantWireIngress: false, // implied by wantIngress
wantControlUpdate: true,
},
}