Skip to content

Commit 15f0f0d

Browse files
authored
Be less verbose with handshake send errors (#1810)
1 parent 7902ce6 commit 15f0f0d

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

handshake_manager.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,13 @@ func (hm *HandshakeManager) handleOutbound(vpnIp netip.Addr, lighthouseTriggered
295295
hm.messageMetrics.Tx(header.Handshake, hh.machine.Subtype(), 1)
296296
err := hm.outside.WriteTo(stage0, addr)
297297
if err != nil {
298-
hostinfo.logger(hm.l).Error("Failed to send handshake message",
298+
// These repeat every attempt, so match the success log below and only shout when the remotes changed
299+
level := slog.LevelDebug
300+
if remotesHaveChanged {
301+
level = slog.LevelError
302+
}
303+
304+
hostinfo.logger(hm.l).Log(context.Background(), level, "Failed to send handshake message",
299305
"udpAddr", addr,
300306
"initiatorIndex", hostinfo.localIndexId,
301307
"handshake", hsFields,

inside.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (f *Interface) sendNoMetrics(t header.MessageType, st header.MessageSubType
408408
if err != nil {
409409
hostinfo.logger(f.l).Error("Failed to write outgoing packet",
410410
"error", err,
411-
"udpAddr", remote,
411+
"udpAddr", hr,
412412
)
413413
}
414414
} else {

0 commit comments

Comments
 (0)