* suppress gen_id 1, sig_id 2000328
* suppress gen_id 1, sig_id 2000328, track by_src, ip fe80::/10
*/
-#define DETECT_SUPPRESS_REGEX "^,\\s*track\\s*(by_dst|by_src)\\s*,\\s*ip\\s*([\\da-fA-F.:/]+)*\\s*$"
+#define DETECT_SUPPRESS_REGEX "^,\\s*track\\s*(by_dst|by_src)\\s*,\\s*ip\\s*([\\[\\],\\$\\da-zA-Z.:/_]+)*\\s*$"
/* Default path for the threshold.config file */
#if defined OS_WIN32 || defined __CYGWIN__
de->seconds = parsed_seconds;
de->new_action = parsed_new_action;
de->timeout = parsed_timeout;
- de->addr = NULL;
if (parsed_track != TRACK_RULE) {
- de->addr = DetectAddressInit();
- if (de->addr == NULL) {
- SCLogError(SC_ERR_MEM_ALLOC, "Can't init DetectAddress");
- goto error;
- }
- if (DetectAddressParseString(de->addr, (char *)th_ip) < 0) {
- SCLogError(SC_ERR_INVALID_IP_NETBLOCK, "Can't add %s to address group", th_ip);
+ if (DetectAddressParse((const DetectEngineCtx *)de_ctx, &de->addrs, (char *)th_ip) != 0) {
+ SCLogError(SC_ERR_INVALID_IP_NETBLOCK, "failed to parse %s", th_ip);
goto error;
}
}
de->seconds = parsed_seconds;
de->new_action = parsed_new_action;
de->timeout = parsed_timeout;
- de->addr = NULL;
if (parsed_track != TRACK_RULE) {
- de->addr = DetectAddressInit();
- if (de->addr == NULL) {
- SCLogError(SC_ERR_MEM_ALLOC, "Can't init DetectAddress");
- goto error;
- }
- if (DetectAddressParseString(de->addr, (char *)th_ip) < 0) {
- SCLogError(SC_ERR_INVALID_IP_NETBLOCK, "Can't add %s to address group", th_ip);
+ if (DetectAddressParse((const DetectEngineCtx *)de_ctx, &de->addrs, (char *)th_ip) != 0) {
+ SCLogError(SC_ERR_INVALID_IP_NETBLOCK, "failed to parse %s", th_ip);
goto error;
}
}
de->new_action = parsed_new_action;
de->timeout = parsed_timeout;
- de->addr = DetectAddressInit();
- if (de->addr == NULL) {
- SCLogError(SC_ERR_MEM_ALLOC, "Can't init DetectAddress");
- goto error;
- }
- if (DetectAddressParseString(de->addr, (char *)th_ip) < 0) {
- SCLogError(SC_ERR_INVALID_IP_NETBLOCK, "Can't add %s to address group", th_ip);
+ if (DetectAddressParse((const DetectEngineCtx *)de_ctx, &de->addrs, (char *)th_ip) != 0) {
+ SCLogError(SC_ERR_INVALID_IP_NETBLOCK, "failed to parse %s", th_ip);
goto error;
}
return 0;
error:
if (de != NULL) {
- if (de->addr != NULL)
- DetectAddressFree(de->addr);
+ DetectAddressHeadCleanup(&de->addrs);
SCFree(de);
}
return -1;
de->seconds = parsed_seconds;
de->new_action = parsed_new_action;
de->timeout = parsed_timeout;
- de->addr = NULL;
sm = SigMatchAlloc();
if (sm == NULL) {
de->seconds = parsed_seconds;
de->new_action = parsed_new_action;
de->timeout = parsed_timeout;
- de->addr = NULL;
sm = SigMatchAlloc();
if (sm == NULL) {
de->seconds = parsed_seconds;
de->new_action = parsed_new_action;
de->timeout = parsed_timeout;
- de->addr = NULL;
sm = SigMatchAlloc();
if (sm == NULL) {
return 0;
error:
if (de != NULL) {
- if (de->addr != NULL)
- DetectAddressFree(de->addr);
+ DetectAddressHeadCleanup(&de->addrs);
SCFree(de);
}
return -1;