Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion libtailscale/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ func (a *App) runBackend(ctx context.Context, hardwareAttestation bool) error {
vpnService.service = nil
}
case i := <-onDNSConfigChanged:
// TODO (barnstar): Consider using [dns.Manager.RecompileDNSConfig] here.
// NetworkChanged injects a netmon event that has the side effect
// regenerating the DNS config but have the means to do
// that independently of userspace engine network changes which may
// eliminate some unnecessary work.
go b.NetworkChanged(i)
}
}
Expand All @@ -265,7 +270,7 @@ func (a *App) newBackend(dataDir string, appCtx AppContext, store *stateStore,
devices: newTUNDevices(),
settings: settings,
appCtx: appCtx,
bus: eventbus.New(),
bus: sys.Bus.Get(),
}

var logID logid.PrivateID
Expand Down
8 changes: 4 additions & 4 deletions libtailscale/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ func (b *backend) NetworkChanged(ifname string) {

// Set the interface name and alert the monitor.
netmon.UpdateLastKnownDefaultRouteInterface(ifname)
if b.sys != nil {
if nm, ok := b.sys.NetMon.GetOK(); ok {
nm.InjectEvent()
}
if b.netMon != nil {
b.netMon.InjectEvent()
} else {
log.Printf("NetworkChanged: netMon is nil")
}
}

Expand Down