Bug #3006
closed
improve rule keyword alproto registration
Added by Victor Julien over 5 years ago.
Updated over 5 years ago.
Description
Improve DetectSignatureSetAppProto by setting the WARN_UNUSED macro on the function prototype and fix the warnings.
Replace all direct 'sets' of Signature::alproto from keyword registration.
- Status changed from New to Assigned
- Assignee changed from OISF Dev to Shivani Bhardwaj
I'm unable to understand the statement, "direct 'sets' of Signature::alproto from keyword registration", could you please make it clearer?
With direct 'sets' I mean code like:
static int DetectHttpUriSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
DetectBufferSetActiveList(s, g_http_uri_buffer_id);
s->alproto = ALPROTO_HTTP;
return 0;
}
Where Signature::alproto is set explicitly.
These cases should be replaced by calls to DetectSignatureSetAppProto. E.g.:
static int DetectHttpMethodSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const char *str)
{
if (DetectBufferSetActiveList(s, g_http_method_buffer_id) < 0)
return -1;
if (DetectSignatureSetAppProto(s, ALPROTO_HTTP) < 0)
return -1;
return 0;
}
- Status changed from Assigned to Feedback
- Status changed from Feedback to Closed
Also available in: Atom
PDF