Bug #9514
opencapture-bypass: entries of flows downgraded to local bypass are never removed
Description
A capture-bypassed flow whose packets still reach Suricata (e.g., packets the capture method doesn't match, like the flow inside PPPoE, which the XDP filter doesn't parse) is downgraded to local bypass in FlowHandlePacketUpdate(). That happens when such a packet arrives more than flow-timeouts.<proto>.bypassed / 2 after lastts.
This results in the state of a capture-bypassed flow being set to FLOW_STATE_LOCAL_BYPASSED.
The bug is that the related capture-bypass entries (e.g., XDP map entries) are never removed and take up capacity of the device until Suricata restarts.
Proposed fix: Add a callback that removes bypass entries when the state of the flow downgrades to FLOW_STATE_LOCAL_BYPASSED.
AK Updated by Adam Kiripolsky 2 days ago
- Status changed from New to In Review
Fix included in PR https://github.com/OISF/suricata/pull/16838.
Suricata-verify test included in https://github.com/OISF/suricata-verify/pull/3628.