backend: Send DNS config through CallbackRouter.

Using NewNoopManager avoided the errors from trying to overwrite
/etc/resolv.conf, but still didn't fully work. Route DNS config
through the CallbackRouter.

Fixes https://github.com/tailscale/tailscale/issues/1956

Signed-off-by: Denton Gentry <dgentry@tailscale.com>
pull/10/head
Denton Gentry 4 years ago
parent 20ddae3208
commit 90351e7392

@ -87,16 +87,14 @@ func newBackend(dataDir string, jvm *jni.JVM, store *stateStore, settings settin
logID.UnmarshalText([]byte(storedLogID)) logID.UnmarshalText([]byte(storedLogID))
} }
b.SetupLogs(dataDir, logID) b.SetupLogs(dataDir, logID)
d, err := dns.NewNoopManager() cb := &router.CallbackRouter{
if err != nil { SetBoth: b.setCfg,
return nil, err SplitDNS: false, // TODO: https://github.com/tailscale/tailscale/issues/1695
} }
engine, err := wgengine.NewUserspaceEngine(logf, wgengine.Config{ engine, err := wgengine.NewUserspaceEngine(logf, wgengine.Config{
Tun: b.devices, Tun: b.devices,
Router: &router.CallbackRouter{ Router: cb,
SetBoth: b.setCfg, DNS: cb,
},
DNS: d,
}) })
if err != nil { if err != nil {
return nil, fmt.Errorf("runBackend: NewUserspaceEngineAdvanced: %v", err) return nil, fmt.Errorf("runBackend: NewUserspaceEngineAdvanced: %v", err)

Loading…
Cancel
Save