]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/lua: Remove unused proto code
authorJeff Lucovsky <jeff@lucovsky.org>
Sun, 31 May 2020 12:07:33 +0000 (08:07 -0400)
committerVictor Julien <victor@inliniac.net>
Wed, 8 Jul 2020 10:26:22 +0000 (12:26 +0200)
This commit removes unused protocol string handling logic.

src/output-lua.c

index c929b60a560af4410bc863d6a09f6ae65438608c..504f176372e5e7200bbd72ddfd3ce89db2648c0b 100644 (file)
@@ -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");