[Oisf-devel] PKT_ALLOC usage

Anoop Saldanha anoopsaldanha at gmail.com
Thu May 9 06:10:42 UTC 2013


On Thu, May 9, 2013 at 1:16 AM, Kenneth Steele <ken at tilera.com> wrote:
> I have a question about the PKT_ALLOC flag. It is set in
> PacketGetFromAlloc() and not in PacketPoolInit() when putting packets in the
> ring buffer. The PKT_ALLOC flag is then checked when releasing a packet to
> either free the Packet or return it to the ring buffer. This makes sense.
>
>


>
> My concern is that PACKET_RECYCLE() clears all flags, include PKT_ALLOC. The
> function FlowForceReassemblyForHash() creates a packet with
> PacketGetFromAlloc(), thus setting PKT_ALLOC, and then calls
> PACKET_RECYCLE() on the same packet, thus clearing the PKT_ALLOC flag. This
> seems inconsistent.
>

Right, this is a bug.

>
>
> Also, many of the Unit Tests directly call SCMalloc(SIZE_OF_PACKET) to
> create a new packet, thus not setting PKT_ALLOC and implying returning the
> Packet to the ring buffer.
>

These unittests return the packet back to the ringbuffer, do they?

>
>
> Would it be better to have an explicit PKT_RING_BUFFER flag?
>
>
>
> Regards,
>
> -Ken
>
>
> _______________________________________________
> Suricata IDS Devel mailing list: oisf-devel at openinfosecfoundation.org
> Site: http://suricata-ids.org | Participate:
> http://suricata-ids.org/participate/
> List: https://lists.openinfosecfoundation.org/mailman/listinfo/oisf-devel
> Redmine: https://redmine.openinfosecfoundation.org/



-- 
Anoop Saldanha



More information about the Oisf-devel mailing list