Simple code fixes

- Removed unnecessary assignment of the data field
- Removed else condition (same function called for IPv4 and IPV6)
- Fixed constants to be a power of two (used in bitwise operations)
pull/1105/merge
Duarte Silva 11 years ago committed by Victor Julien
parent c20bd3bcb2
commit 3a18db13dc

@ -500,9 +500,7 @@ static int AlertDebugLogCondition(ThreadVars *tv, const Packet *p)
static int AlertDebugLogLogger(ThreadVars *tv, void *thread_data, const Packet *p)
{
if (PKT_IS_IPV4(p)) {
return AlertDebugLogger(tv, p, thread_data);
} else if (PKT_IS_IPV6(p)) {
if (PKT_IS_IPV4(p) || PKT_IS_IPV6(p)) {
return AlertDebugLogger(tv, p, thread_data);
} else if (p->events.cnt > 0) {
return AlertDebugLogDecoderEvent(tv, p, thread_data);

@ -1394,7 +1394,6 @@ OutputCtx *Unified2AlertInitCtx(ConfNode *conf)
output_ctx = SCCalloc(1, sizeof(OutputCtx));
if (unlikely(output_ctx == NULL))
goto error;
output_ctx->data = file_ctx;
Unified2AlertFileCtx *unified2alert_ctx = SCMalloc(sizeof(Unified2AlertFileCtx));
if (unlikely(unified2alert_ctx == NULL)) {

@ -67,7 +67,7 @@
#define LOG_JSON_PAYLOAD 1
#define LOG_JSON_PACKET 2
#define LOG_JSON_PAYLOAD_BASE64 4
#define LOG_JSON_HTTP 5
#define LOG_JSON_HTTP 8
#define JSON_STREAM_BUFFER_SIZE 4096

@ -88,7 +88,7 @@ typedef struct Reputation_ {
/* flags for transactions */
#define TRANSACTION_FLAG_NEEDSYNC 0x01 /**< We will apply the transaction only if necesary */
#define TRANSACTION_FLAG_INCS 0x02 /**< We will increment only if necesary */
#define TRANSACTION_FLAG_DECS 0x03 /**< We will decrement only if necesary */
#define TRANSACTION_FLAG_DECS 0x04 /**< We will decrement only if necesary */
/* transaction for feedback */
typedef struct ReputationTransaction_ {

Loading…
Cancel
Save