-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packet Pool fixes #1065
Packet Pool fixes #1065
Conversation
On non-TLS systems, check each time the Thread Local Storage is requested and if it has not been initialized for this thread, initialize it. The prevents not initializing the worker threads in autofp run mode.
PktPool *pool = GetThreadPacketPool(); | ||
if (pool) | ||
return pool; | ||
|
||
/* Create a new pool for this thread. */ | ||
pool = (PktPool*)SCMallocAligned(sizeof(PktPool), CLS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed undeclared 'pool' variable here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I obviously didn’t check the non-TLS case. Sigh.
From: Victor Julien [mailto:notifications@github.com]
Sent: Wednesday, July 30, 2014 5:56 AM
To: inliniac/suricata
Cc: Kenneth Steele
Subject: Re: [suricata] Packet Pool fixes (#1065)
In src/tmqh-packetpool.c:
{
TmqhPacketpoolInit();
- /* Check that the pool is not already created */
- PktPool *pool = GetThreadPacketPool();
- if (pool)
return pool;
/* Create a new pool for this thread. */ pool = (PktPool*)SCMallocAligned(sizeof(PktPool), CLS);
I fixed undeclared 'pool' variable here.
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/1065/files#r15574878.
Merged with one small fix, thanks Ken! |
Thanks. I had been testing non-TLS by editing config.h to comment out the #define TLS line. That might be a good standard test. Easier than compiling on BSD. -Ken From: Victor Julien [mailto:notifications@github.com] Merged with one small fix, thanks Ken! — |
vlan.id matches on Virtual Local Area Network IDs It is an unsigned 16-bit integer Valid range for the default configuration = [1-4094] Supports prefiltering Ticket: OISF#1065
Fixes the non-TLS crash in autofp mode, where only some Packet Pools are initialized, by checking for initialization on each access and initializing if needed.
Adds calls to PacketPoolDestroy() to cleanup allocated memory.
Passes travis-ci