firewall: Keep conntrack entries per peer and recheck them when a peer reconnects

This commit is contained in:
JackDoan committed 2026-10-16 13:41:25 -05:00
1 parent bbc49669b7
commit a0045aef09
6 files changed
+202 -37

No files matched your search

+9 -1
View File
@@ -3,15 +3,23 @@ package firewall
import (
"context"
"log/slog"
"net/netip"
"sync/atomic"
"time"
"github.com/slackhq/nebula/logging"
)
// ConntrackKey identifies a tracked flow by its packet and the peer it was allowed for, so peers that route
// the same unsafe network never share a conntrack entry.
type ConntrackKey struct {
Peer netip.Addr
Packet
}
// ConntrackCache is used as a local routine cache to know if a given flow
// has been seen in the conntrack table.
type ConntrackCache map[Packet]struct{}
type ConntrackCache map[ConntrackKey]struct{}
type ConntrackCacheTicker struct {
cacheV uint64