From a843b36c97818ce0ecb5f00bf09bdeca4bd14272 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Sun, 31 May 2020 08:07:33 -0400 Subject: [PATCH] output/lua: Remove unused proto code This commit removes unused protocol string handling logic. --- src/output-lua.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) 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");