[client] Fix flows for embedded listeners (#3564)

This commit is contained in:
Viktor Liu 2025-03-22 18:51:48 +01:00 committed by GitHub
parent 2bbe0f3f09
commit 99b41543b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -710,21 +710,18 @@ func (m *Manager) handleLocalTraffic(d *decoder, srcIP, dstIP netip.Addr, packet
} }
// if running in netstack mode we need to pass this to the forwarder // if running in netstack mode we need to pass this to the forwarder
if m.netstack { if m.netstack && m.localForwarding {
return m.handleNetstackLocalTraffic(packetData) return m.handleNetstackLocalTraffic(packetData)
} }
// track inbound packets to get the correct direction and session id for flows // track inbound packets to get the correct direction and session id for flows
m.trackInbound(d, srcIP, dstIP, ruleID, size) m.trackInbound(d, srcIP, dstIP, ruleID, size)
// pass to either native or virtual stack (to be picked up by listeners)
return false return false
} }
func (m *Manager) handleNetstackLocalTraffic(packetData []byte) bool { func (m *Manager) handleNetstackLocalTraffic(packetData []byte) bool {
if !m.localForwarding {
// pass to virtual tcp/ip stack to be picked up by listeners
return false
}
fwd := m.forwarder.Load() fwd := m.forwarder.Load()
if fwd == nil { if fwd == nil {

View File

@ -198,7 +198,7 @@ func (m *Manager) receiveACKs(client *client.GRPCClient) {
return nil return nil
} }
log.Tracef("received flow event ack: %s", id) log.Tracef("received flow event ack: %s", id)
m.logger.DeleteEvents([]uuid.UUID{uuid.UUID(ack.EventId)}) m.logger.DeleteEvents([]uuid.UUID{id})
return nil return nil
}) })