Hello,
I ran the code through an analysis program and found several memory leaks
in the alert code.
*In src/alert-fastlog.c at line 178, aft was not being freed
*In src/alert-debuglog.c at line 205, aftwas not being freed
*In src/alert-unified-log.c at lines 234 and 243, aun was not being freed
*In src/alert-unified-alert.c at lines 219 and 230, aun was not being freed
*In src/alert-unified2-alert.c at line 505, aun was not being freed
The patch below fixes this.
-Steve
- Increase the packet buffer so it can hold the link header when we
have maximum size IP datagrams.
- Fix ip header length and pkt length calculation for re-assembled
packets.
This patch modifies max queue length computation logic. The max queue
length was set to MAX_PENDING which is the total number of packet
processed simultaneously in suricata.
This value is correct but this will not permit to take all burst
effects into account (read sudden quantity of packet that arrives
faster than suricata is enable to parse). Furthermore there is a
delaying system when suricata gets overloaded which make necessary
to have packet storable into kernel for some time.
To improve this situation the patch increases the maximum queue
length to NFQ_BURST_FACTOR (4) time the MAX_PENDING packet and
it also increase the nfnetlink buffer size to be able to store
all packets waiting for suricata in the netlink receive buffer.
This patch fixes gcc warning:
warning: suggest braces around empty body in an ‘if’ statement
This was the case in when the macro SCLogDebug was used:
if (ssn != NULL)
SCLogDebug("ssn->alproto %"PRIu16"", ssn->alproto);
It also fixes a signed-unsigned comparison.
This patch convert a 'else if' serie to a switch to increase
the readability of the decision related code.
Please enter the commit message for your changes. Lines starting