]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve: micro simplification
authorEric Leblond <el@stamus-networks.com>
Sun, 2 Oct 2022 12:57:28 +0000 (14:57 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 3 Oct 2022 09:03:17 +0000 (11:03 +0200)
src/output-json.c

index ef7fa58d109d99ddbb5883b483439ebbdec210f1..5b75d5f75b902ebda3125b8f6431deee55a5276a 100644 (file)
@@ -563,19 +563,7 @@ void JsonAddrInfoInit(const Packet *p, enum OutputJsonLogDirection dir, JsonAddr
             return;
     }
 
-
     strlcpy(addr->src_ip, srcip, JSON_ADDR_LEN);
-
-    switch(p->proto) {
-        case IPPROTO_ICMP:
-            break;
-        case IPPROTO_UDP:
-        case IPPROTO_TCP:
-        case IPPROTO_SCTP:
-            addr->sp = sp;
-            break;
-    }
-
     strlcpy(addr->dst_ip, dstip, JSON_ADDR_LEN);
 
     switch(p->proto) {
@@ -584,6 +572,7 @@ void JsonAddrInfoInit(const Packet *p, enum OutputJsonLogDirection dir, JsonAddr
         case IPPROTO_UDP:
         case IPPROTO_TCP:
         case IPPROTO_SCTP:
+            addr->sp = sp;
             addr->dp = dp;
             break;
     }