mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 07:56:52 +01:00
firewall: Keep conntrack entries per peer and recheck them when a peer reconnects
This commit is contained in:
1 parent
bbc49669b7
commit
a0045aef09
6 files changed
+202
-37
No files matched your search
+9
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user