detect/ike.vendor: update buffer initialization logic

pull/8482/head
Victor Julien 4 years ago
parent 158e648d87
commit 849f1cf1b8

@ -56,7 +56,7 @@ static int g_ike_vendor_buffer_id = 0;
static InspectionBuffer *IkeVendorGetData(DetectEngineThreadCtx *det_ctx, static InspectionBuffer *IkeVendorGetData(DetectEngineThreadCtx *det_ctx,
const DetectEngineTransforms *transforms, Flow *f, struct IkeVendorGetDataArgs *cbdata, const DetectEngineTransforms *transforms, Flow *f, struct IkeVendorGetDataArgs *cbdata,
int list_id, bool first) int list_id)
{ {
SCEnter(); SCEnter();
@ -64,7 +64,7 @@ static InspectionBuffer *IkeVendorGetData(DetectEngineThreadCtx *det_ctx,
InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id); InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id);
if (buffer == NULL) if (buffer == NULL)
return NULL; return NULL;
if (!first && buffer->inspect != NULL) if (buffer->initialized)
return buffer; return buffer;
const uint8_t *data; const uint8_t *data;
@ -98,8 +98,7 @@ static void PrefilterTxIkeVendor(DetectEngineThreadCtx *det_ctx, const void *pec
uint32_t local_id = 0; uint32_t local_id = 0;
while (1) { while (1) {
struct IkeVendorGetDataArgs cbdata = { local_id, txv }; struct IkeVendorGetDataArgs cbdata = { local_id, txv };
InspectionBuffer *buffer = InspectionBuffer *buffer = IkeVendorGetData(det_ctx, ctx->transforms, f, &cbdata, list_id);
IkeVendorGetData(det_ctx, ctx->transforms, f, &cbdata, list_id, true);
if (buffer == NULL) if (buffer == NULL)
break; break;
@ -151,7 +150,7 @@ static uint8_t DetectEngineInspectIkeVendor(DetectEngineCtx *de_ctx, DetectEngin
txv, txv,
}; };
InspectionBuffer *buffer = InspectionBuffer *buffer =
IkeVendorGetData(det_ctx, transforms, f, &cbdata, engine->sm_list, false); IkeVendorGetData(det_ctx, transforms, f, &cbdata, engine->sm_list);
if (buffer == NULL || buffer->inspect == NULL) if (buffer == NULL || buffer->inspect == NULL)
break; break;

Loading…
Cancel
Save