protoptr = proto;
}
- /* Not sure if this mutex is needed around calls to syslog. */
- SCMutexLock(&ast->file_ctx->fp_mutex);
-
for (i = 0; i < p->alerts.cnt; i++) {
const PacketAlert *pa = &p->alerts.alerts[i];
if (unlikely(pa->s == NULL)) {
action = "[wDrop] ";
}
+ /* Not sure if this mutex is needed around calls to syslog. */
+ SCMutexLock(&ast->file_ctx->fp_mutex);
syslog(alert_syslog_level, "%s[%" PRIu32 ":%" PRIu32 ":%"
PRIu32 "] %s [Classification: %s] [Priority: %"PRIu32"]"
" {%s} %s:%" PRIu32 " -> %s:%" PRIu32 "", action, pa->s->gid,
pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg, pa->s->prio,
protoptr, srcip, p->sp, dstip, p->dp);
+ SCMutexUnlock(&ast->file_ctx->fp_mutex);
}
- SCMutexUnlock(&ast->file_ctx->fp_mutex);
return TM_ECODE_OK;
}
protoptr = proto;
}
- SCMutexLock(&ast->file_ctx->fp_mutex);
-
for (i = 0; i < p->alerts.cnt; i++) {
const PacketAlert *pa = &p->alerts.alerts[i];
if (unlikely(pa->s == NULL)) {
action = "[wDrop] ";
}
+ SCMutexLock(&ast->file_ctx->fp_mutex);
syslog(alert_syslog_level, "%s[%" PRIu32 ":%" PRIu32 ":%"
"" PRIu32 "] %s [Classification: %s] [Priority: %"
"" PRIu32 "] {%s} %s:%" PRIu32 " -> %s:%" PRIu32 "",
action, pa->s->gid, pa->s->id, pa->s->rev, pa->s->msg, pa->s->class_msg,
pa->s->prio, protoptr, srcip, p->sp,
dstip, p->dp);
-
+ SCMutexUnlock(&ast->file_ctx->fp_mutex);
}
- SCMutexUnlock(&ast->file_ctx->fp_mutex);
return TM_ECODE_OK;
}
if (p->alerts.cnt == 0)
return TM_ECODE_OK;
- SCMutexLock(&ast->file_ctx->fp_mutex);
-
char temp_buf_hdr[512];
char temp_buf_pkt[65] = "";
char temp_buf_tail[64];
}
strlcat(alert, temp_buf_tail, sizeof(alert));
+ SCMutexLock(&ast->file_ctx->fp_mutex);
syslog(alert_syslog_level, "%s", alert);
+ SCMutexUnlock(&ast->file_ctx->fp_mutex);
}
- SCMutexUnlock(&ast->file_ctx->fp_mutex);
return TM_ECODE_OK;
}