AF-Packet bypass function in some situations allocates EBPF bypass data
for an already bypassed flow and assigns it to the flow without any checks
Issue: #5368
(cherry picked from commit
8845c07a90ff6ad8304c25f6ccdd495623d35d53)
{
FlowBypassInfo *fc = FlowGetStorageById(p->flow, GetFlowBypassInfoID());
if (fc) {
+ if (fc->bypass_data != NULL) {
+ // bypass already activated
+ SCFree(key0);
+ SCFree(key1);
+ return 1;
+ }
EBPFBypassData *eb = SCCalloc(1, sizeof(EBPFBypassData));
if (eb == NULL) {
EBPFDeleteKey(map_fd, key0);