From: Victor Julien Date: Tue, 3 Apr 2012 12:57:13 +0000 (+0200) Subject: Fix error in proto handling for ipv6 in fast.log. X-Git-Tag: suricata-1.3beta1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c682c5f1dd142c5ccf7f204f3dc0e63db93051de;p=thirdparty%2Fsuricata.git Fix error in proto handling for ipv6 in fast.log. --- diff --git a/src/alert-fastlog.c b/src/alert-fastlog.c index e22da0debf..a7060447ee 100644 --- a/src/alert-fastlog.c +++ b/src/alert-fastlog.c @@ -197,10 +197,10 @@ TmEcode AlertFastLogIPv6(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, } char proto[16] = ""; - if (SCProtoNameValid(IPV4_GET_IPPROTO(p)) == TRUE) { + 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, IPV4_GET_IPPROTO(p)); + snprintf(proto, sizeof(proto), "PROTO:%03" PRIu32, IP_GET_IPPROTO(p)); } SCMutexLock(&aft->file_ctx->fp_mutex); @@ -253,11 +253,11 @@ TmEcode AlertFastLogDecoderEvent(ThreadVars *tv, Packet *p, void *data, PacketQu PrintRawLineHexFp(aft->file_ctx->fp, GET_PKT_DATA(p), GET_PKT_LEN(p) < 32 ? GET_PKT_LEN(p) : 32); if (p->pcap_cnt != 0) { - fprintf(aft->file_ctx->fp, "] [pcap file packet: %"PRIu64"]", p->pcap_cnt); + fprintf(aft->file_ctx->fp, "] [pcap file packet: %"PRIu64"]\n", p->pcap_cnt); + } else { + fprintf(aft->file_ctx->fp, "]\n"); } - fprintf(aft->file_ctx->fp,"\n"); - fflush(aft->file_ctx->fp); aft->file_ctx->alerts++; SCMutexUnlock(&aft->file_ctx->fp_mutex);