From: Jeff Lucovsky Date: Sun, 31 May 2020 12:07:33 +0000 (-0400) Subject: output/lua: Remove unused proto code X-Git-Tag: suricata-6.0.0-beta1~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a843b36c97818ce0ecb5f00bf09bdeca4bd14272;p=thirdparty%2Fsuricata.git output/lua: Remove unused proto code This commit removes unused protocol string handling logic. --- diff --git a/src/output-lua.c b/src/output-lua.c index c929b60a56..504f176372 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Open Information Security Foundation +/* Copyright (C) 2014-2020 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -196,13 +196,6 @@ static int LuaPacketLoggerAlerts(ThreadVars *tv, void *thread_data, const Packet goto not_supported; } - 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)); - } - /* loop through alerts stored in the packet */ SCMutexLock(&td->lua_ctx->m); uint16_t cnt; @@ -267,13 +260,6 @@ static int LuaPacketLogger(ThreadVars *tv, void *thread_data, const Packet *p) CreateTimeString(&p->ts, timebuf, sizeof(timebuf)); - 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)); - } - /* loop through alerts stored in the packet */ SCMutexLock(&td->lua_ctx->m); lua_getglobal(td->lua_ctx->luastate, "log");