Use new call limiter in network state tables

Potentially fixes #1043, #1294
This commit is contained in:
Daniel
2023-09-28 15:04:54 +02:00
parent 6fc7c8c169
commit 577299c95b
5 changed files with 83 additions and 212 deletions

View File

@@ -37,7 +37,7 @@ func Exists(pktInfo *packet.Info, now time.Time) (exists bool) {
func (table *tcpTable) exists(pktInfo *packet.Info) (exists bool) {
// Update tables if older than the connection that is checked.
if table.lastUpdateAt.Load() < pktInfo.SeenAt.UnixNano() {
table.updateTables(table.updateIter.Load())
table.updateTables()
}
table.lock.RLock()
@@ -64,7 +64,7 @@ func (table *tcpTable) exists(pktInfo *packet.Info) (exists bool) {
func (table *udpTable) exists(pktInfo *packet.Info, now time.Time) (exists bool) {
// Update tables if older than the connection that is checked.
if table.lastUpdateAt.Load() < pktInfo.SeenAt.UnixNano() {
table.updateTables(table.updateIter.Load())
table.updateTables()
}
table.lock.RLock()