packsieve expects dynmem_alloc() allocated payloads, buffers get released when processing is done
This commit is contained in:
parent
a6ee1d3fe5
commit
99e7d26e67
@ -28,7 +28,7 @@ void packsieve_input(PcktSieve *sieve, const RawPckt *rawPckt) {
|
|||||||
// extract fields
|
// extract fields
|
||||||
uint8_t *data = rawPckt->payload;
|
uint8_t *data = rawPckt->payload;
|
||||||
uint32_t size = rawPckt->size;
|
uint32_t size = rawPckt->size;
|
||||||
bool mrd = false; // 'Must Release Data': at the end of processing not only release headers but data buffer as well
|
bool mrd = true; // 'Must Release Data': at the end of processing not only release headers but data buffer as well
|
||||||
|
|
||||||
restart:;
|
restart:;
|
||||||
// process payload, fetch packet class etc.
|
// process payload, fetch packet class etc.
|
||||||
@ -63,6 +63,7 @@ void packsieve_input(PcktSieve *sieve, const RawPckt *rawPckt) {
|
|||||||
procRet = cdesc->procFun(data + offset, size - offset, header, sieve->intf, &pb);
|
procRet = cdesc->procFun(data + offset, size - offset, header, sieve->intf, &pb);
|
||||||
switch (procRet) {
|
switch (procRet) {
|
||||||
case PROC_FN_RET_REPRST:
|
case PROC_FN_RET_REPRST:
|
||||||
|
dynmem_free(data); // release previous packet data
|
||||||
data = pb.p; // store new packet data
|
data = pb.p; // store new packet data
|
||||||
size = pb.u;
|
size = pb.u;
|
||||||
mrd = pb.b;
|
mrd = pb.b;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user