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 12 years ago
parent cef609bb73
commit c4e1324690

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

Loading…
Cancel
Save