Fix matching TCP connections

This commit is contained in:
Daniel
2023-03-30 11:36:44 +02:00
parent 4b29eed2cf
commit b9488c1a8f

View File

@@ -129,9 +129,14 @@ func (table *tcpTable) findSocket(pktInfo *packet.Info) (
}
}
remoteIP := pktInfo.RemoteIP()
remotePort := pktInfo.RemotePort()
// search connections
for _, socketInfo := range table.connections {
if localPort == socketInfo.Local.Port &&
remotePort == socketInfo.Remote.Port &&
remoteIP.Equal(socketInfo.Remote.IP) &&
localIP.Equal(socketInfo.Local.IP) {
return socketInfo, false
}