From d2ef73ed82a6259a1a0489cf4acabd88d5ff7280 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 10 Nov 2021 08:11:14 -0800 Subject: [PATCH] control/controlclient: rename a variable to not shadow a package name Change-Id: I1bcb577cb2c47e936d545ad57f308e57399de323 Signed-off-by: Brad Fitzpatrick --- control/controlclient/direct.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index ce15486cc..0f3178159 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -291,8 +291,8 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new tryingNewKey := c.tryingNewKey serverKey := c.serverKey authKey := c.authKey - hostinfo := c.hostinfo.Clone() - backendLogID := hostinfo.BackendLogID + hi := c.hostinfo.Clone() + backendLogID := hi.BackendLogID expired := c.expiry != nil && !c.expiry.IsZero() && c.expiry.Before(c.timeNow()) c.mu.Unlock() @@ -366,7 +366,7 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new Version: 1, OldNodeKey: oldNodeKey, NodeKey: tryingNewKey.Public(), - Hostinfo: hostinfo, + Hostinfo: hi, Followup: opt.URL, Timestamp: &now, Ephemeral: (opt.Flags & LoginEphemeral) != 0, @@ -562,8 +562,8 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm persist := c.persist serverURL := c.serverURL serverKey := c.serverKey - hostinfo := c.hostinfo.Clone() - backendLogID := hostinfo.BackendLogID + hi := c.hostinfo.Clone() + backendLogID := hi.BackendLogID localPort := c.localPort var epStrs []string var epTypes []tailcfg.EndpointType @@ -607,13 +607,13 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm Endpoints: epStrs, EndpointTypes: epTypes, Stream: allowStream, - Hostinfo: hostinfo, + Hostinfo: hi, DebugFlags: c.debugFlags, OmitPeers: cb == nil, } var extraDebugFlags []string - if hostinfo != nil && c.linkMon != nil && !c.skipIPForwardingCheck && - ipForwardingBroken(hostinfo.RoutableIPs, c.linkMon.InterfaceState()) { + if hi != nil && c.linkMon != nil && !c.skipIPForwardingCheck && + ipForwardingBroken(hi.RoutableIPs, c.linkMon.InterfaceState()) { extraDebugFlags = append(extraDebugFlags, "warn-ip-forwarding-off") } if health.RouterHealth() != nil {