|
|
|
|
@ -2166,7 +2166,7 @@ func (b *LocalBackend) setWgengineStatus(s *wgengine.Status, err error) {
|
|
|
|
|
es := b.parseWgStatusLocked(s)
|
|
|
|
|
cc := b.cc
|
|
|
|
|
b.engineStatus = es
|
|
|
|
|
needUpdateEndpoints := !endpointsEqual(s.LocalAddrs, b.endpoints)
|
|
|
|
|
needUpdateEndpoints := !slices.Equal(s.LocalAddrs, b.endpoints)
|
|
|
|
|
if needUpdateEndpoints {
|
|
|
|
|
b.endpoints = append([]tailcfg.Endpoint{}, s.LocalAddrs...)
|
|
|
|
|
}
|
|
|
|
|
@ -2192,18 +2192,6 @@ func (b *LocalBackend) broadcastStatusChanged() {
|
|
|
|
|
b.statusLock.Unlock()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func endpointsEqual(x, y []tailcfg.Endpoint) bool {
|
|
|
|
|
if len(x) != len(y) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
for i := range x {
|
|
|
|
|
if x[i] != y[i] {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SetNotifyCallback sets the function to call when the backend has something to
|
|
|
|
|
// notify the frontend about. Only one callback can be set at a time, so calling
|
|
|
|
|
// this function will replace the previous callback.
|
|
|
|
|
|