|
|
|
@ -620,6 +620,19 @@ void SigCleanSignatures()
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static int SignatureIsIPOnly(DetectEngineCtx *de_ctx, Signature *s) {
|
|
|
|
static int SignatureIsIPOnly(DetectEngineCtx *de_ctx, Signature *s) {
|
|
|
|
|
|
|
|
/* in the case of tcp/udp, only consider sigs that
|
|
|
|
|
|
|
|
* don't have ports set ip-only. */
|
|
|
|
|
|
|
|
if (!(s->proto.flags & DETECT_PROTO_ANY)) {
|
|
|
|
|
|
|
|
if (s->proto.proto[(IPPROTO_TCP/8)] & (1<<(IPPROTO_TCP%8)) ||
|
|
|
|
|
|
|
|
s->proto.proto[(IPPROTO_UDP/8)] & (1<<(IPPROTO_UDP%8))) {
|
|
|
|
|
|
|
|
if (!(s->flags & SIG_FLAG_SP_ANY))
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!(s->flags & SIG_FLAG_DP_ANY))
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SigMatch *sm = s->match;
|
|
|
|
SigMatch *sm = s->match;
|
|
|
|
if (sm == NULL)
|
|
|
|
if (sm == NULL)
|
|
|
|
goto iponly;
|
|
|
|
goto iponly;
|
|
|
|
@ -637,6 +650,8 @@ static int SignatureIsIPOnly(DetectEngineCtx *de_ctx, Signature *s) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
} else if (sm->type == DETECT_FLOWVAR) {
|
|
|
|
} else if (sm->type == DETECT_FLOWVAR) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
} else if (sm->type == DETECT_FLOWBITS) {
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
} else if (sm->type == DETECT_DSIZE) {
|
|
|
|
} else if (sm->type == DETECT_DSIZE) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|