From 98c391396c09726b758711152161ba1d45096bb5 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Fri, 30 Apr 2021 19:19:40 -0400 Subject: [PATCH] Remove log when no handshake message is sent (#452) --- .github/workflows/test.yml | 4 ++-- handshake_manager.go | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6b57a7..3d717e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: run: make test - name: End 2 end - run: make e2e + run: make e2evv test: name: Build and test on ${{ matrix.os }} @@ -77,4 +77,4 @@ jobs: run: go test -v ./... - name: End 2 end - run: go test -tags=e2e_testing -count=1 ./e2e + run: make e2evv diff --git a/handshake_manager.go b/handshake_manager.go index 313f568..e97d85b 100644 --- a/handshake_manager.go +++ b/handshake_manager.go @@ -165,10 +165,13 @@ func (c *HandshakeManager) handleOutbound(vpnIP uint32, f EncWriter, lighthouseT } }) - hostinfo.logger(c.l).WithField("udpAddrs", sentTo). - WithField("initiatorIndex", hostinfo.localIndexId). - WithField("handshake", m{"stage": 1, "style": "ix_psk0"}). - Info("Handshake message sent") + // Don't be too noisy or confusing if we fail to send a handshake - if we don't get through we'll eventually log a timeout + if len(sentTo) > 0 { + hostinfo.logger(c.l).WithField("udpAddrs", sentTo). + WithField("initiatorIndex", hostinfo.localIndexId). + WithField("handshake", m{"stage": 1, "style": "ix_psk0"}). + Info("Handshake message sent") + } // Increment the counter to increase our delay, linear backoff hostinfo.HandshakeCounter++