wgengine/router: enumerate all interfaces when finding Tailscale adapter by GUID

Might fix it. I've spent too much time failing to reproduce the issue. This doesn't
seem to make it worse, though (it still runs for me), so I'll include this and
see if it helps others while I still work on a reliable way to reproduce it.

Updates tailscale/corp#474
pull/776/head
Brad Fitzpatrick 4 years ago
parent 5bcac4eaac
commit fd77268770

@ -217,7 +217,13 @@ func setPrivateNetwork(ifcGUID *windows.GUID) (bool, error) {
func configureInterface(cfg *Config, tun *tun.NativeTun) error {
const mtu = 0
guid := tun.GUID()
iface, err := winipcfg.InterfaceFromGUID(&guid)
iface, err := winipcfg.InterfaceFromGUIDEx(&guid, &winipcfg.GetAdapterAddressesFlags{
// Issue 474: on early boot, when the network is still
// coming up, if the Tailscale service comes up first,
// the Tailscale adapter it finds might not have the
// IPv4 service available yet? Try this flag:
GAA_FLAG_INCLUDE_ALL_INTERFACES: true,
})
if err != nil {
return err
}

Loading…
Cancel
Save