detect: extend PrefilterPacketHeaderValue to 16 bytes

pull/4702/head
Philippe Antoine 5 years ago committed by Victor Julien
parent d04d69acbb
commit bb7abbd6ec

@ -31,7 +31,7 @@ typedef struct PrefilterPacketHeaderHashCtx_ {
static uint32_t PrefilterPacketHeaderHashFunc(HashListTable *ht, void *data, uint16_t datalen)
{
PrefilterPacketHeaderCtx *ctx = data;
uint64_t hash = ctx->v1.u64 + ctx->type + ctx->value;
uint64_t hash = ctx->v1.u64[0] + ctx->v1.u64[1] + ctx->type + ctx->value;
hash %= ht->array_size;
return hash;
}
@ -41,7 +41,8 @@ static char PrefilterPacketHeaderCompareFunc(void *data1, uint16_t len1,
{
PrefilterPacketHeaderHashCtx *ctx1 = data1;
PrefilterPacketHeaderHashCtx *ctx2 = data2;
return (ctx1->v1.u64 == ctx2->v1.u64 &&
return (ctx1->v1.u64[0] == ctx2->v1.u64[0] &&
ctx1->v1.u64[1] == ctx2->v1.u64[1] &&
ctx1->type == ctx2->type &&
ctx1->value == ctx2->value);
}

@ -19,10 +19,10 @@
#define __DETECT_ENGINE_PREFILTER_COMMON_H__
typedef union {
uint8_t u8[8];
uint16_t u16[4];
uint32_t u32[2];
uint64_t u64;
uint8_t u8[16];
uint16_t u16[8];
uint32_t u32[4];
uint64_t u64[2];
} PrefilterPacketHeaderValue;
#define PREFILTER_EXTRA_MATCH_UNUSED 0

Loading…
Cancel
Save