Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
relay -> udp addr
  • Loading branch information
ethanndickson committed Jul 10, 2024
commit 60e88f7582406f76a0efce56a31f147ddbbf0cea
2 changes: 1 addition & 1 deletion tailnet/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ func (c *Conn) watchConnChange() {
}
peer := status.Peer[peers[0]]
// If the connection type has changed, send a telemetry event with the latest ping stats
if c.telemetryStore.changedConntype(peer.Relay) {
if c.telemetryStore.changedConntype(peer.CurAddr) {
c.telemetryStore.pingPeer(c)
}
}
Expand Down
8 changes: 4 additions & 4 deletions tailnet/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ func (b *TelemetryStore) pingPeer(conn *Conn) {
}()
}

func (b *TelemetryStore) changedConntype(relay string) bool {
func (b *TelemetryStore) changedConntype(addr string) bool {
b.mu.Lock()
defer b.mu.Unlock()

if b.p2p && relay == "" {
if b.p2p && addr != "" {
return false
} else if !b.p2p && relay == "" {
} else if !b.p2p && addr != "" {
b.p2p = true
b.p2pSetupTime = time.Since(b.lastDerpTime)
return true
} else if b.p2p && relay != "" {
} else if b.p2p && addr == "" {
b.p2p = false
b.lastDerpTime = time.Now()
b.p2pSetupTime = 0
Expand Down