diff --git a/src/alert-fastlog.c b/src/alert-fastlog.c index ca62155a02..7613a37ad1 100644 --- a/src/alert-fastlog.c +++ b/src/alert-fastlog.c @@ -141,19 +141,16 @@ int AlertFastLogger(ThreadVars *tv, void *data, const Packet *p) action = "[wDrop] "; } - char proto[16] = ""; + /* Create the alert string without locking. */ + int size = 0; if (likely(decoder_event == 0)) { + char proto[16] = ""; if (SCProtoNameValid(IP_GET_IPPROTO(p)) == TRUE) { strlcpy(proto, known_proto[IP_GET_IPPROTO(p)], sizeof(proto)); } else { snprintf(proto, sizeof(proto), "PROTO:%03" PRIu32, IP_GET_IPPROTO(p)); } - } - - /* Create the alert string without locking. */ - int size = 0; - if (likely(decoder_event == 0)) { - PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE, + PrintBufferData(alert_buffer, &size, MAX_FASTLOG_ALERT_SIZE, "%s %s[**] [%" PRIu32 ":%" PRIu32 ":%" PRIu32 "] %s [**] [Classification: %s] [Priority: %"PRIu32"]" " {%s} %s:%" PRIu32 " -> %s:%" PRIu32 "\n", timebuf, action,