mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 09:47:49 +02:00
[client] Fix flows for embedded listeners (#3564)
This commit is contained in:
parent
2bbe0f3f09
commit
99b41543b8
@ -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 {
|
||||||
|
@ -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
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user