From 218de6d53008a0456449ae7618c36d1e0219f600 Mon Sep 17 00:00:00 2001 From: Dmytro Shynkevych Date: Wed, 22 Jul 2020 13:37:41 -0400 Subject: [PATCH] ipn: load hostname in Start. This prevents hostname being forced to os.Hostname despite override when control is contacted for the first time after starting tailscaled. Signed-off-by: Dmytro Shynkevych --- ipn/local.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipn/local.go b/ipn/local.go index c9759cb65..6a5f8baf5 100644 --- a/ipn/local.go +++ b/ipn/local.go @@ -353,6 +353,9 @@ func (b *LocalBackend) Start(opts Options) error { b.serverURL = b.prefs.ControlURL hostinfo.RoutableIPs = append(hostinfo.RoutableIPs, b.prefs.AdvertiseRoutes...) hostinfo.RequestTags = append(hostinfo.RequestTags, b.prefs.AdvertiseTags...) + if b.prefs.Hostname != "" { + hostinfo.Hostname = b.prefs.Hostname + } b.notify = opts.Notify b.netMap = nil