From 88afd75768bc765a7231adb31d4d68c4259e7d08 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 22 Mar 2022 15:29:30 +0100 Subject: [PATCH] Fix metrics for connections going through SPN --- firewall/tunnel.go | 1 + network/metrics.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/firewall/tunnel.go b/firewall/tunnel.go index 79bc592d..32d60de1 100644 --- a/firewall/tunnel.go +++ b/firewall/tunnel.go @@ -96,6 +96,7 @@ func checkTunneling(ctx context.Context, conn *network.Connection, pkt packet.Pa } // Tunnel all the things! + conn.SaveWhenFinished() // Check if ready. if !captain.ClientReady() { diff --git a/network/metrics.go b/network/metrics.go index 720856ae..7867cea4 100644 --- a/network/metrics.go +++ b/network/metrics.go @@ -124,7 +124,7 @@ func (conn *Connection) addToMetrics() { blockedOutConnCounter.Inc() conn.addedToMetrics = true return - case VerdictAccept: + case VerdictAccept, VerdictRerouteToTunnel: // Continue to next section. default: // Connection is not counted.