fix for bug #557.

In FFRv2, dereference flow from a packet using the new reference/dereference
util macros.  This allows the decr use_cnt for flow and reseting the flow
pointer to NULL for the pseudo pkt to happen simultaneously, in case there we
fail to retrieve a pseudo_packet and have to return the already obtained
pseudo packets, back to the packetpool.
pull/103/merge
Anoop Saldanha 13 years ago committed by Victor Julien
parent 88e89d6302
commit 6c68f86b8c

@ -369,19 +369,23 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
if (server == 1) {
p2 = FlowForceReassemblyPseudoPacketGet(0, f, ssn, 0);
if (p2 == NULL) {
TmqhOutputPacketpool(NULL,p1);
FlowDeReference(&p1->flow);
TmqhOutputPacketpool(NULL, p1);
return 1;
}
p3 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
if (p3 == NULL) {
FlowDeReference(&p1->flow);
TmqhOutputPacketpool(NULL, p1);
FlowDeReference(&p2->flow);
TmqhOutputPacketpool(NULL, p2);
return 1;
}
} else {
p2 = FlowForceReassemblyPseudoPacketGet(0, f, ssn, 1);
if (p2 == NULL) {
FlowDeReference(&p1->flow);
TmqhOutputPacketpool(NULL, p1);
return 1;
}
@ -396,6 +400,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
p2 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
if (p2 == NULL) {
FlowDeReference(&p1->flow);
TmqhOutputPacketpool(NULL, p1);
return 1;
}
@ -408,6 +413,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
if (server == 2) {
p2 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
if (p2 == NULL) {
FlowDeReference(&p1->flow);
TmqhOutputPacketpool(NULL, p1);
return 1;
}
@ -423,6 +429,7 @@ int FlowForceReassemblyForFlowV2(Flow *f, int server, int client)
p2 = FlowForceReassemblyPseudoPacketGet(1, f, ssn, 1);
if (p2 == NULL) {
FlowDeReference(&p1->flow);
TmqhOutputPacketpool(NULL, p1);
return 1;
}

Loading…
Cancel
Save