From 1cebf5d0eb9f7bede1a14adcafbb8ec58a229505 Mon Sep 17 00:00:00 2001 From: Nate Brown Date: Mon, 24 Jul 2023 17:06:08 -0500 Subject: [PATCH] Try to find what is writing after close --- .github/workflows/test.yml | 44 +++----------------------------------- e2e/handshakes_test.go | 2 ++ outside.go | 1 + udp/udp_tester.go | 10 +++++++++ 4 files changed, 16 insertions(+), 41 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1be159043..a5d889a59 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,23 +25,8 @@ jobs: go-version-file: 'go.mod' check-latest: true - - name: Build - run: make all - - - name: Vet - run: make vet - - - name: Test - run: make test - - name: End 2 end - run: make e2evv - - - uses: actions/upload-artifact@v3 - with: - name: e2e packet flow - path: e2e/mermaid/ - if-no-files-found: warn + run: make e2evvv test-linux-boringcrypto: name: Build and test on linux with boringcrypto @@ -55,14 +40,8 @@ jobs: go-version-file: 'go.mod' check-latest: true - - name: Build - run: make bin-boringcrypto - - - name: Test - run: make test-boringcrypto - - name: End 2 end - run: make e2evv GOEXPERIMENT=boringcrypto CGO_ENABLED=1 + run: make e2evvv GOEXPERIMENT=boringcrypto CGO_ENABLED=1 test: name: Build and test on ${{ matrix.os }} @@ -79,23 +58,6 @@ jobs: go-version-file: 'go.mod' check-latest: true - - name: Build nebula - run: go build ./cmd/nebula - - - name: Build nebula-cert - run: go build ./cmd/nebula-cert - - - name: Vet - run: make vet - - - name: Test - run: make test - - name: End 2 end - run: make e2evv + run: make e2evvv - - uses: actions/upload-artifact@v3 - with: - name: e2e packet flow - path: e2e/mermaid/ - if-no-files-found: warn diff --git a/e2e/handshakes_test.go b/e2e/handshakes_test.go index aa6260314..d02a1a733 100644 --- a/e2e/handshakes_test.go +++ b/e2e/handshakes_test.go @@ -410,6 +410,8 @@ func TestStage1RaceRelays(t *testing.T) { p := r.RouteForAllUntilTxTun(myControl) _ = p + r.FlushAll() + myControl.Stop() theirControl.Stop() relayControl.Stop() diff --git a/outside.go b/outside.go index 19a980bfa..a5de80480 100644 --- a/outside.go +++ b/outside.go @@ -292,6 +292,7 @@ func (f *Interface) handleEncrypted(ci *ConnectionState, addr *udp.Addr, h *head // Else, send recv errors for 300 seconds after a restart to allow fast reconnection. if ci == nil || !ci.window.Check(f.l, h.MessageCounter) { if addr != nil { + f.l.Error("NATE", h.String()) f.maybeSendRecvError(addr, h.RemoteIndex) return false } else { diff --git a/udp/udp_tester.go b/udp/udp_tester.go index f03a69cbe..f3c412000 100644 --- a/udp/udp_tester.go +++ b/udp/udp_tester.go @@ -104,6 +104,16 @@ func (u *TesterConn) WriteTo(b []byte, addr *Addr) error { copy(p.ToIp, addr.IP.To16()) copy(p.FromIp, u.Addr.IP.To16()) + defer func() { + if err := recover(); err != nil { + h := header.H{} + h.Parse(b) + fmt.Println("Packet header was: ", h.String()) + fmt.Println(err) + panic("Re-panic") + } + }() + u.TxPackets <- p return nil }