flow: set datalink for pseudo packet

Set pseudo packet datalink to the global one. This fixes the case
where the pcap handle is open with information coming from a
pseudo packet. Without this, we did end up in most cases with
an Ethernet packet being written in a Raw pcap.
pull/7430/head
Eric Leblond 4 years ago committed by Victor Julien
parent 1c2fba57f8
commit 2c2fc6cd91

@ -53,6 +53,7 @@
#include "util-debug.h"
#include "util-privs.h"
#include "util-datalink.h"
#include "detect.h"
#include "detect-engine-state.h"
@ -82,7 +83,7 @@ static inline Packet *FlowForceReassemblyPseudoPacketSetup(Packet *p,
{
const int orig_dir = direction;
p->tenant_id = f->tenant_id;
p->datalink = DLT_RAW;
p->datalink = DatalinkGetGlobalType();
p->proto = IPPROTO_TCP;
FlowReference(&p->flow, f);
p->flags |= PKT_STREAM_EST;

Loading…
Cancel
Save