flow-timeout: use packet pool

Use packet pool for pseudo packets on flow timeout. Wait for a packet
if necessary.

For shutdown, alloc a new pool as the 'main()' thread calls this.
pull/1272/head
Victor Julien 10 years ago
parent cef609bb73
commit c4e1324690

@ -238,11 +238,13 @@ static inline Packet *FlowForceReassemblyPseudoPacketGet(int direction,
TcpSession *ssn,
int dummy)
{
Packet *p;
p = PacketGetFromAlloc();
if (p == NULL)
PacketPoolWait();
Packet *p = PacketPoolGetPacket();
if (p == NULL) {
return NULL;
}
PACKET_PROFILING_START(p);
return FlowForceReassemblyPseudoPacketSetup(p, direction, f, ssn, dummy);
}
@ -535,9 +537,11 @@ static inline void FlowForceReassemblyForHash(void)
*/
void FlowForceReassembly(void)
{
/* called by 'main()' which has no packet pool */
PacketPoolInit();
/* Carry out flow reassembly for unattended flows */
FlowForceReassemblyForHash();
PacketPoolDestroy();
return;
}

Loading…
Cancel
Save